betty.app package

Submodules

Module contents

Define Betty’s core application functionality.

final class betty.app.App[source]

Bases: Configurable[AppConfiguration], CoreComponent

The Betty application.

__init__(configuration: AppConfiguration, cache_directory_path: Path, *, cache_factory: Callable[[Self], Cache[Any]])[source]
property assets: AssetRepository

The assets file system.

property binary_file_cache: BinaryFileCache

The binary file cache.

property cache: Cache[Any]

The cache.

property fetcher: Fetcher

The fetcher.

property http_client: ClientSession

The HTTP client.

property localizer: Localizer

Get the application’s localizer.

property localizers: LocalizerRepository

The available localizers.

classmethod new_from_environment() AsyncIterator[Self][source]

Create a new application from the environment.

classmethod new_temporary() AsyncIterator[Self][source]

Creat a new, temporary, isolated application.

The application will not use any persistent caches, or leave any traces on the system.

property process_pool: Executor

The shared process pool.

Use this to run CPU/computationally-heavy tasks in other processes.