betty.project.extension.wikipedia package - Betty documentation

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

# betty.project.extension.wikipedia package

## Submodules

- betty.project.extension.wikipedia.config module
  - `WikipediaConfiguration`
    - `WikipediaConfiguration.__init__()`
    - `WikipediaConfiguration.dump()`
    - `WikipediaConfiguration.load()`
    - `WikipediaConfiguration.populate_images`

## Module contents

Integrate Betty with Wikipedia.

final class betty.project.extension.wikipedia.Wikipedia

  Bases: `ShorthandPluginBase`, `ConfigurableExtension`[`WikipediaConfiguration`], `Jinja2Provider`

  Integrates Betty with Wikipedia.

  __init__(project: Project, wikipedia_contributors_copyright_notice: CopyrightNotice, *, configuration: WikipediaConfiguration)
  classmethod assets_directory_path() → Path | None

    Return the path on disk where the extension’s assets are located.

    This may be anywhere in your Python package.

  async filter_wikipedia_links(context: Context, links: Iterable[Link]) → Iterable[Summary]

    Given a sequence of links, return any Wikipedia summaries for them.

  property filters: Mapping[str, Callable[[...], Any]]

    Jinja2 filters provided by this extension.

    Keys are filter names, and values are the filters themselves.

  property globals: Mapping[str, Any]

    Jinja2 globals provided by this extension.

    Keys are the globals’ names, and values are the globals’ values.

  classmethod new_default_configuration() → WikipediaConfiguration

    Create this extension’s default configuration.

  async classmethod new_for_project(project: Project) → Self

    Create a new instance using the given project.

  rate_limiter
  register_event_handlers(registry: EventHandlerRegistry) → None

    Register event handlers with the project.

  retriever