Most properties and generators accept the same parameters as the API, without their two-letter prefix. Some notable exceptions:
Image.imageinfois the imageinfo of the latest image. Earlier versions can be fetched using
categorymembersis implemented as
- First parameters of
Properties and generators are implemented as Python generators. Their limit parameter is only an indication of the number of items in one chunk. It is not the total limit. Doing
list(generator(limit = limit)) will return ALL items of generator, and not be limited by the limit value. Use
list(generator(max_items = max_items)) to limit the amount of items returned. Default chunk size is generally the maximum chunk size.
The base Page object is called
and from that derive
When the page is retrieved via
Site.pages or a generator,
it will check automatically which of those three specific types
should be returned.
Site.categories are also provided.
These do exactly the same as Site.Pages, except that they require the page name
without its namespace prefixed.
>>> page = site.Pages['Template:Stub'] # a Page object >>> image = site.Pages['Image:Wiki.png'] # an Image object >>> image = site.Images['Wiki.png'] # the same Image object >>> cat = site.Pages['Category:Python'] # a Category object >>> cat = site.Images['Python'] # the same Category object