Skip to content
Steve edited this page Sep 18, 2017 · 30 revisions

Getting data in wptools centers on request "actions". We make API requests to get data, and then we assign values from the data to selected "data" attribute members. Most actions map to a get_{action} method that attempts to get as much information as possible through that API entry point. We cache the end-to-end query data (request URL, HTTP response metadata or info, and the full response) in the cache attribute of each object. There is typically far more information in the cached response than what is exposed by listing page data with the core show() method.

Page actions

The methods below are made available to a page object by the core module. The fetch module ultimately forms these requests and executes them.

Action Method Description
claims get_claims Wikidata:API action=wbgetentities request for Q entity labels
imageinfo get_imageinfo Mediawiki API:Imageinfo request for image info
parse get_parse MediaWiki:API action=parse request for parsetree/infobox data
query get_query MediaWiki:API action=query request for extracts, image files, etc.
rest get_rest RESTBase /page/ requests for page content
wikidata get_wikidata Wikidata:API action=wbgetentities for page wikidata

Category actions

Site actions

Clone this wiki locally