betty.wikipedia module - Betty 0.4.0a3 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.wikipedia module

Fetch information from Wikipedia.

class betty.wikipedia.Image

  Bases: `object`

  An image from Wikimedia Commons.

  Parameters:

    - path (`pathlib.Path`)

    - media_type (`betty.media_type.MediaType`)

    - title (`str`)

    - wikimedia_commons_url (`str`)

    - name (`str`)

  __init__(path: pathlib.Path, media_type: betty.media_type.MediaType, title: str, wikimedia_commons_url: str, name: str)
    Parameters:

      - path (`pathlib.Path`)

      - media_type (`betty.media_type.MediaType`)

      - title (`str`)

      - wikimedia_commons_url (`str`)

      - name (`str`)

  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

  Bases: `WikipediaError`, `ValueError`

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

exception betty.wikipedia.RetrievalError

  Bases: `WikipediaError`, `RuntimeError`

  An error that occurred when retrieving content from Wikipedia.

class betty.wikipedia.Summary

  Bases: `Localized`

  A Wikipedia page summary.

  Parameters:

    - locale (`str`)

    - name (`str`)

    - title (`str`)

    - content (`str`)

  __init__(locale: str, name: str, title: str, content: str)
    Parameters:

      - locale (`str`)

      - name (`str`)

      - title (`str`)

      - content (`str`)

  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

  Bases: `BaseException`

  An error raised by Betty’s Wikipedia API.