betty.config 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.config package

## Subpackages

- betty.config.collections package
  - Submodules
    - betty.config.collections.mapping module
      - `ConfigurationMapping`
        - `ConfigurationMapping.dump()`
        - `ConfigurationMapping.load()`
      - `OrderedConfigurationMapping`
        - `OrderedConfigurationMapping.dump()`
        - `OrderedConfigurationMapping.load()`
    - betty.config.collections.sequence module
      - `ConfigurationSequence`
        - `ConfigurationSequence.__init__()`
        - `ConfigurationSequence.append()`
        - `ConfigurationSequence.dump()`
        - `ConfigurationSequence.insert()`
        - `ConfigurationSequence.keys()`
        - `ConfigurationSequence.load()`
        - `ConfigurationSequence.prepend()`
        - `ConfigurationSequence.replace()`
        - `ConfigurationSequence.to_index()`
        - `ConfigurationSequence.to_key()`
        - `ConfigurationSequence.update()`
        - `ConfigurationSequence.values()`
  - Module contents
    - `ConfigurationCollection`
      - `ConfigurationCollection.__init__()`
      - `ConfigurationCollection.append()`
      - `ConfigurationCollection.clear()`
      - `ConfigurationCollection.insert()`
      - `ConfigurationCollection.keys()`
      - `ConfigurationCollection.load_item()`
      - `ConfigurationCollection.prepend()`
      - `ConfigurationCollection.remove()`
      - `ConfigurationCollection.replace()`
      - `ConfigurationCollection.to_index()`
      - `ConfigurationCollection.to_indices()`
      - `ConfigurationCollection.to_key()`
      - `ConfigurationCollection.to_keys()`
      - `ConfigurationCollection.values()`

## Module contents

The Configuration API.

class betty.config.Configurable

  Bases: `Generic`[`_ConfigurationT`]

  Any configurable object.

  __init__(*args: Any, **kwargs: Any)
  property configuration: _ConfigurationT

    The object’s configuration.

class betty.config.Configuration

  Bases: `Dumpable`

  Any configuration object.

  __init__(*args: Any, **kwargs: Any)
  abstract load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) → None

    Load dumped configuration.

    Raises:

      betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

  abstract update(other: Self) → None

    Update this configuration with the values from `other`.

betty.config.assert_configuration_file(configuration: _ConfigurationT) → AssertionChain[Path, _ConfigurationT]

  Assert that configuration can be loaded from a file.

async betty.config.write_configuration_file(configuration: Configuration, configuration_file_path: Path) → None

  Write configuration to file.