betty.config.collections 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.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.values()`

## Module contents

Define and provide collections of `betty.config.Configuration` instances.

class betty.config.collections.ConfigurationCollection

  Bases: `Configuration`, `Generic`[`_ConfigurationKeyT`, `_ConfigurationT`]

  Any collection of `betty.config.Configuration` values.

  To test your own subclasses, use `betty.test_utils.config.collections.ConfigurationCollectionTestBase`.

  __init__(configurations: Iterable[_ConfigurationT] | None = None)
  abstractmethod append(*configurations: _ConfigurationT) → None

    Append the given values to the end of the sequence.

  clear() → None

    Clear all items from the collection.

  abstractmethod insert(index: int, *configurations: _ConfigurationT) → None

    Insert the given values at the given index.

  abstractmethod keys() → Iterator[_ConfigurationKeyT]

    Get all keys in this collection.

  abstractmethod prepend(*configurations: _ConfigurationT) → None

    Prepend the given values to the beginning of the sequence.

  remove(*configuration_keys: _ConfigurationKeyT) → None

    Remove the given keys from the collection.

  abstractmethod replace(*configurations: _ConfigurationT) → None

    Replace any existing values with the given ones.

  abstractmethod values() → Iterator[_ConfigurationT]

    Get all values in this collection.