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