Reference¶
pythondev_example.console¶
Command-line interface.
pythondev_example.wikipedia¶
Client for the Wikipedia REST API, version 1.
- class pythondev_example.wikipedia.Page(title, extract)¶
Page resource.
- title¶
The title of the Wikipedia page.
- Type
str
- extract¶
A plain text summary.
- Type
str
- pythondev_example.wikipedia.random_page(language='en')¶
random_page Return a random page.
Performs a GET request to the /page/random/summary endpoint.
- Parameters
language (str) – The Wikipedia language edition. Defaults to “en”.
- Raises
ClickException – The HTTP request failed or the HTTP response contained an invalid body.
- Returns
A page resource.
- Return type
Example
>>> from pythondev_example import wikipedia >>> page = wikipedia.random_page(language="en") >>> bool(page.title) True