Last modified: 2014-11-09 19:55:50 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/335/ Reported by: cdpark Created on: 2013-04-08 01:52:09 Subject: Support for Wikimedia Labs and Toolserver Original description: 1\. Source directory repositiory Split pywikipedia source and user config/script. See also https://wikitech.wikimedia.org/wiki/Nova\_Resource\_Talk:Bots\#Pywikipediabot Currently, pywikipedia imports\(or includes\) other file from \(1\) source code directory \(2\) current working directory \(3\) pywikipedia environment, depends on code. How about to support PYWIKIPEDIA\_HOME or similar environment for source code repository. 2\. Local mysql mirror support. In WMLabs and toolserver, access of wikipedia mirror is available. Page.get\(\) and pagegenerators can be use this information. \(BTW, Page.put\(\) should work to original site, not mirrors\). It can be also useful for other mediawiki installs if admin runs some pywikipedia-based script \(e.g. replace.py\) for his own database.
\#1: This is implemented in the rewrite branch, you just set the PYWIKIBOT2\_DIR variable to where your user-config is. \#2: I think this would be an interesting layer to add onto pywikipedia. Probably can be done with a "MysqlSite" or something, since all queries should get routed through that. DB access doesn't mean you have page text access, so it isn't \*that\* useful.
I think the latter is possible and we can do something about it
The Toolserver is closed as of July 1st 2014.
The 'quickest' way to get mysql data access integrate is to write a generator which takes a generator, iterates over each title and yields a preloaded Page using Mysql data. There are a few more 'fun' ways to do a better job, and would be suitable for a GSOC project, such as subclassing APISite/Request and overriding only the methods which are useful to serve from MySQL