Manual:Pywikibot/Compat/query.py
< Manual:Pywikibot​‎ | Compat
This page is documentation for Pywikipedia Compat, which is no longer supported. This page is kept for historical interest. It may document scripts and features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date.
query.py is a library for pywikibot compat branch used by several scripts
Methods​[​edit​]
MethodParamsDescription
GetDatalang
params
verbose = False
Get data from the query api, and convert it into a data object
GetInterwikieslang
titles
extraParams = None
Uses GetData to fetch "redirects" and "langlinks" for the given titles.
GetLinkslang
titles
extraParams = None
Uses GetData to fetch "redirects" and "links" for the given titles.
GetDisambigTemplateslangThis 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
CleanParamsparamsParams may be either a tuple, a list of tuples or a dictionary. This method will convert it into a dictionary
CombineParamsparams1
params2
Merge two dictionaries. If they have the same keys, their values will be appended one after another separated by the '|' symbol.
ConvToListitemEnsure the output is a list
ListToParamlistConvert a list of unicode strings into a UTF8 string separated by the '|' symbols
ToUtf8sConvert s to Unicode
IsStringsBoolean test
Categories: Pages kept for historical interestPywikibot compat scripts
Search
This page was last edited on 3 March 2021, at 19:50.
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details.
Privacy policy
About MediaWiki.org
Disclaimers
Code of Conduct
Mobile view
Developers
Statistics
Cookie statement

TalkContributionsCreate accountLog in
ManualDiscussion
ReadEditView history
Visit the main pageMain pageGet MediaWikiGet extensionsTech blogContributeUser helpFAQTechnical manualSupport deskCommunicationBug trackerCode docsCode repositoryStatisticsCommunity portalRecent changesTranslate contentRandom pageVillage pumpSandboxWhat links hereRelated changesUpload fileSpecial pagesPermanent linkPage informationCite this pageCreate a bookDownload as PDFPrintable versionEnglishAdd links