Reference

x_ae_a_12.console

Command-line interface.

x_ae_a_12.wikipedia

Client for the Wikipedia REST API, version 1.

class x_ae_a_12.wikipedia.Page(title, extract)

Page resource.

title

The title of the wikipedia page.

extract

A plain text summary.

x_ae_a_12.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

Page

Returns

A page resource

Raises

ClickException – The HTTP request failed or the HTTP response contained an invalid body.

Example

>>> from x_ae_a_12 import wikipedia
>>> page = wikipedia.random_page(language="sw")
>>> bool(page.title)
True