betty.app package - Betty 0.4.0a4 documentation

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

# betty.app package

## Submodules

- betty.app.config module
  - `AppConfiguration`
    - `AppConfiguration.__init__()`
    - `AppConfiguration.dump()`
    - `AppConfiguration.load()`
    - `AppConfiguration.locale`
    - `AppConfiguration.update()`

## Module contents

Define Betty’s core application functionality.

final class betty.app.App

  Bases: `Configurable`[`AppConfiguration`], `CoreComponent`

  The Betty application.

  __init__(configuration: AppConfiguration, cache_directory_path: Path, *, cache_factory: Callable[[Self], Cache[Any]])
  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]

    Create a new application from the environment.

  classmethod new_temporary() → AsyncIterator[Self]

    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.