betty.wikipedia module

Fetch information from Wikipedia.

class betty.wikipedia.Image[source]

Bases: object

An image from Wikimedia Commons.

Parameters:
__init__(path: pathlib._local.Path, media_type: betty.media_type.MediaType, title: str, wikimedia_commons_url: str, name: str)[source]
Parameters:
property media_type: MediaType

The image’s media type.

property name: str

The image’s file name.

property path: Path

The path to the image on disk.

property title: str

The human-readable image title.

property wikimedia_commons_url: str

The URL to the Wikimedia Commons web page for this image.

exception betty.wikipedia.NotAPageError[source]

Bases: WikipediaError, ValueError

Raised when a URL does not point to a Wikipedia page.

exception betty.wikipedia.RetrievalError[source]

Bases: WikipediaError, RuntimeError

An error that occurred when retrieving content from Wikipedia.

class betty.wikipedia.Summary[source]

Bases: Localized

A Wikipedia page summary.

Parameters:
__init__(locale: str, name: str, title: str, content: str)[source]
Parameters:
property content: str

The page’s human-readable summary content.

property name: str

The page’s machine name.

property title: str

The page’s human-readable title.

property url: str

The URL to the web page.

exception betty.wikipedia.WikipediaError[source]

Bases: BaseException

An error raised by Betty’s Wikipedia API.