betty.project.extension.wikipedia package¶
Submodules¶
Module contents¶
Integrate Betty with Wikipedia.
- final class betty.project.extension.wikipedia.Wikipedia[source]¶
Bases:
ShorthandPluginBase
,ConfigurableExtension
[WikipediaConfiguration
],Jinja2Provider
Integrates Betty with Wikipedia.
- __init__(project: Project, wikipedia_contributors_copyright_notice: CopyrightNotice, *, configuration: WikipediaConfiguration)[source]¶
- classmethod assets_directory_path() Path | None [source]¶
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] [source]¶
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 [source]¶
Create this extension’s default configuration.
- async classmethod new_for_project(project: Project) Self [source]¶
Create a new instance using the given project.
- register_event_handlers(registry: EventHandlerRegistry) None [source]¶
Register event handlers with the project.
- property retriever: Awaitable[_Retriever]¶
The Wikipedia content retriever.