Manual:Pywikibot/Compat/query.py: Difference between revisions
< Manual:Pywikibot | Compat
m moved Query.py to Pywikipediabot/query.py: Bot moving to subpage (redirect suppressed) |
DeirdreAnne (talk | contribs) m 3 revisions from meta:Pywikipediabot/query.py: Migrating documentation for mediawiki tool maintained in svn |
||
(No difference)
|
Revision as of 21:36, 10 December 2011
Wikimedia Git repository has this file: scripts/query.py |
query.py is a library for pywikipediabot used by casechecker.py and copyright_clean.py.
Methods
Method | Params | Description |
---|---|---|
GetData | lang params verbose = False |
Get data from the query.php api, and convert it into a data object |
GetInterwikies | lang titles extraParams = None |
Uses GetData to fetch "redirects" and "langlinks" for the given titles. |
GetLinks | lang titles extraParams = None |
Uses GetData to fetch "redirects" and "links" for the given titles. |
GetDisambigTemplates | lang | This method will return a set of disambiguation templates. is always assumed to be default, and will be appended (in localized format) regardless of its existence. The rest will be acquired from the Wikipedia:Disambiguation Templates page.(Note: this page was deleted in August 2006) Only links to templates will be used from that page. |
Helper Utilities | ||
CleanParams | params | Params may be either a tuple, a list of tuples or a dictionary. This method will convert it into a dictionary |
CombineParams | params1 params2 |
Merge two dictionaries. If they have the same keys, their values will be appended one after another separated by the '|' symbol. |
ConvToList | item | Ensure the output is a list |
ListToParam | list | Convert a list of unicode strings into a UTF8 string separated by the '|' symbols |
ToUtf8 | s | Convert s to Unicode |
IsString | s | Boolean test |