Manual:Pywikibot/2.0

Pywikipediabot 2.0 aka "rewrite" was proposed in 2007, but has never been ready to replace the current "trunk" version. This is a list of things that we should do to get it ready.

Goals

 * Be ready to merge at the end of Summer 2013.
 * Provide a seamless transition for bot operators and writers.
 * Make it easier to make raw API calls.
 * Proper distinction between programs (give output and user interaction) and libraries

To be done

 * Many site methods not yet implemented.
 * All trunk scripts should be converted over. (/Porting status)
 * Create a script called  to provide a compatibility layer. (/Conversion)
 * Some programs need to be split into a program and library part (for example upload.py)
 * login.py has some weird quirks that need to be looked into (hack workaround at /login.py, maybe this has to do with the path itself?)
 * Move api.update_page to a method of the page class
 * Find a way to cache tokens between login sessions.
 * Unit tests
 * All the unit tests for  are failing.
 * Documentation, documentation, documentation!

Ideas
--Yurik (talk) 06:13, 22 March 2013 (UTC)
 * Python3 compatibility!
 * As a general tip, all code committed now should try to be as Python3 compatible as possible. (Don't use {}.has_key, use 'key' in {}, etc)
 * Replace Page.templatesWithParams with a true parser, mwparserfromhell, by User:The Earwig
 * Content+Site model is needed. The current structure of pywiki centers around a "page" object. This object is both the container of data, plus the networking code. It allows someone to write page.content to get the page markup from a site, which might be somewhat convenient, yet it promotes non-batched usage which is much heavier on wiki. Instead, page object should be a local-only container of data and related (parsing) code, whereas all network access should be done by the Site object. Syntax might be different, but the concepts should stay: