Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Aeterna Config

aeterna-config provides asynchronous, layered configuration that becomes an immutable snapshot after it is built. It is the standard-library-only configuration foundation for the Aeterna packages.

Features

  • Load asynchronous configuration providers in registration order.
  • Recursively overlay mappings; later scalars, lists, tuples, and None replace earlier values.
  • Read values with colon-delimited paths, create section views, and inspect provenance.
  • Bind values strictly to annotated dataclasses, primitive types, collections, mappings, enums, unions, and Any.
  • Supply in-memory mappings and environment variables without an adapter dependency.

Requirements

  • Python 3.12 or later.
  • No runtime dependencies outside the Python standard library.

Installation

With pip:

pip install aeterna-config

With uv:

uv add aeterna-config

Basic usage

Build the snapshot asynchronously, then read a path or bind a section to a dataclass.

import asyncio
from dataclasses import dataclass

from aeterna.config import ConfigurationBuilder


@dataclass
class DatabaseSettings:
    host: str
    port: int


async def main() -> None:
    configuration = await (
        ConfigurationBuilder()
        .add_mapping({"database": {"host": "localhost", "port": "5432"}})
        .build()
    )

    settings = configuration.bind(DatabaseSettings, "database")
    print(settings.host)  # localhost


asyncio.run(main())

Configuration details

ConfigurationBuilder loads providers in registration order. Mapping values are merged recursively, while later scalar, list, tuple, or None values replace earlier values. build() creates an immutable snapshot; reads never reload providers. as_mapping() is also immutable, and source() reports the provider that last supplied a path when known.

EnvironmentProvider converts environment variable names to nested paths. Its default delimiter is __, and it lowercases path segments unless case_sensitive=True. For example, APP_DATABASE__PORT=5432 becomes database:port with prefix="APP_". Environment values remain strings until binding.

builder.add_environment(prefix="APP_")

Providers implement ConfigurationProvider: a stable name property and an asynchronous load() method returning a mapping. This lets adapters such as aeterna-config-yaml use the same builder. Provider failures cross the builder boundary as sanitized errors.

Public API

Classes and protocol:

  • ConfigurationBuilder: collects providers and asynchronously builds a snapshot.
  • Configuration: immutable snapshot with get(), require(), contains(), section(), bind(), as_mapping(), and source().
  • ConfigurationBinder: binds a value to an annotated target with bind().
  • ConfigurationProvider: protocol for asynchronous mapping providers.
  • MappingProvider: provider backed by an in-memory mapping.
  • EnvironmentProvider: provider that reads environment variables.

Exceptions:

  • ConfigurationError: base class for configuration failures.
  • ProviderError: a provider failed without exposing its original details.
  • MergeError: provider data cannot be represented as a configuration tree.
  • MissingValueError: a requested configuration path is absent.
  • BindingError: a value cannot be converted to the requested type.

Tests

From the repository root:

uv sync --locked
uv run pytest tests/test_config.py

Release files for aeterna-config 1.0.0.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aeterna-config 1.0.0.dev1
File Size Uploaded
aeterna_config-1.0.0.dev1.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aeterna-config 1.0.0.dev1
File Interpreter ABI Platform
aeterna_config-1.0.0.dev1-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / aeterna_config-1.0.0.dev1.tar.gz

Download URL aeterna_config-1.0.0.dev1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
77caadf24c2a06f2078f53d0eaef4bc96b2602382af3cbe816d247f186f1829a
BLAKE2b-256 checksum
How to use checksums
77401606991e3ce599516715322fda5413092665876d15fa778b2d7f94f2fec1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / aeterna_config-1.0.0.dev1-py3-none-any.whl

Download URL aeterna_config-1.0.0.dev1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b5b14cdd2d43de2ffee8c5652b69b48646176d1932546b784cde79e6991807a
BLAKE2b-256 checksum
How to use checksums
560621d505f69fc4a275a79704e065958e3f8f857515461691304f5560e0fe62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0.dev1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page