Skip to main content

Flexible layered configuration management built on Pydantic Settings.

Project description

CI PyPI - Version PyPI - Python Version GitHub License

Durango

Durango is a lightweight configuration management toolkit that layers strongly typed settings, configuration files, environment variables, and programmatic overrides using Pydantic Settings. It is designed for CLI tools and services that need predictable precedence, multi-format config files, and clear error reporting.

Key Features

  • Config precedence: defaults → config file → environment variables → user overrides.
  • Format flexibility: parse YAML, JSON, or TOML files by default with optional extras.
  • Typed settings: describe your configuration with Pydantic models and receive fully validated objects.
  • Reload aware: refresh configuration at runtime and hook into lifecycle callbacks.
  • Extensible: adapt environment prefixes, merge behaviour, and file lookup strategies to fit your application.

Quick Start

from durango import ConfigManager, DurangoSettings


class AppSettings(DurangoSettings):
    debug: bool = False
    api_url: str


manager = ConfigManager(
    settings_type=AppSettings,
    identifier="MYAPP",
    default_file="~/.config/myapp/settings.yaml",
)

settings = manager.load()
print(settings.api_url)

If ~/.config/myapp/settings.yaml does not exist, Durango will create it and populate it with the model defaults before layering environment variables and runtime overrides.

Environment variables take the form MYAPP__API_URL=true. To override a nested section named database, use MYAPP__DATABASE__URL.

Documentation

  • Docs site (WIP): see docs/
  • Architecture notes: ARCH.md
  • Working session notes: notes/STATUS.md

Contributing

See docs/contributing.md for full setup, workflow, and review guidelines. Highlights:

  • Install dependencies with uv sync --all-extras --dev.
  • Run uv run invoke ci before opening a pull request.
  • Publishing and release automation are covered in docs/publishing.md.

License

Durango is available under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durango-0.1.2.tar.gz (328.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

durango-0.1.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file durango-0.1.2.tar.gz.

File metadata

  • Download URL: durango-0.1.2.tar.gz
  • Upload date:
  • Size: 328.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for durango-0.1.2.tar.gz
Algorithm Hash digest
SHA256 73a7a79ca35cad7fc99b3ab9bf9345da6f811120cef1e7d591fa0baae7e56bb0
MD5 459a03985647687d7dfb59c07c059233
BLAKE2b-256 ef7a1b8ed2a1b820590d06c662a60efcebd5be1df5b7da901b215e5dcfd04401

See more details on using hashes here.

File details

Details for the file durango-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: durango-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for durango-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abf82e71a675b1746cb0fb7a949486ffeca0e0fcafa530324f0a233605273de7
MD5 1fb86da363a1d58a1427a08c8bb11ab5
BLAKE2b-256 9cb91f2d400b20968b31f832b56b453b6a3f322e80ca8292470437cb37323e29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page