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