Skip to main content

didactic-settings

Typed application settings on top of dx.Model.

PyPI Python License CI Docs

Contributes didactic.settings to the namespace package.

Install

pip install didactic-settings
pip install 'didactic-settings[yaml]'   # adds YAML support

The package depends on didactic. The optional yaml extra adds PyYAML for .yaml / .yml config files.

Quickstart

import didactic.api as dx
from didactic.settings import Settings, EnvSource, FileSource


class AppSettings(Settings):
    debug: bool = False
    db_url: str
    port: int = 8080

    __sources__ = (
        FileSource(path="config.toml"),
        EnvSource(prefix="APP_"),
    )


cfg = AppSettings.load()
cfg.port                      # the resolved value
cfg.__provenance__["port"]    # 'env' / 'file' / 'default' / 'override'

Settings inherits from dx.Model, so every Model feature works: type checks, axioms, validators, JSON Schema export.

Sources

source reads from
EnvSource(prefix="APP_") environment variables
DotEnvSource(path=".env", prefix="APP_") dotenv file
FileSource(path="config.toml") JSON, TOML, or YAML by suffix
CliSource(args=ns) parsed argparse.Namespace or dict

Sources are walked in declaration order; later sources override earlier ones. Keyword overrides at Settings.load(...) win over every source.

Documentation

See Guides > Settings for the full source documentation, coercion rules, and provenance reporting.

License

Released under the MIT License.

Metadata

Release files for didactic-settings 0.15.0

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

Source distribution (sdist)

Source distribution for didactic-settings 0.15.0
File Size Uploaded
didactic_settings-0.15.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for didactic-settings 0.15.0
File Interpreter ABI Platform
didactic_settings-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / didactic_settings-0.15.0.tar.gz

Download URL didactic_settings-0.15.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cbf54da468129cb95f26bbdac95589ae62b6e1123f8afd0093c031f5e6c50016
BLAKE2b-256 checksum
How to use checksums
11e355176df80e9d3fb0708be9c6a39e0e8d2692cb33dc4a1bf192aa1af52662
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 12, 2026.

Transparency log

Release files / didactic_settings-0.15.0-py3-none-any.whl

Download URL didactic_settings-0.15.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aefb4183d7efb80587fcc035e8b7649fa7b3679384c03f2c45d36972d354567
BLAKE2b-256 checksum
How to use checksums
4f5d0b52ddb81bff8349e555de2e08e7885722b81649f2116fb8109632ed515f
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 12, 2026.

Transparency log
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