Skip to main content
dature

PyPI Supported Python versions Documentation License
CI CodeQL Dependency Review Coverage
Monthly downloads Commits since latest release Last commit date Last release date

Documentation | Changelog

Type-safe configuration loader for Python dataclasses. Load config from YAML, JSON, TOML, INI, ENV files, environment variables, Docker secrets, CLI arguments, HashiCorp Vault, Consul, etcd, Apache ZooKeeper, AWS SSM, AWS Secrets Manager, Azure App Configuration, Azure Key Vault, and GCP Secret Manager — with automatic type conversion, validation, and human-readable error messages.

Installation

pip install dature

With optional format support:

pip install dature[yaml]       # YAML (ruamel.yaml)
pip install dature[json5]      # JSON5
pip install dature[toml]       # TOML (toml_rs)
pip install dature[vault]      # HashiCorp Vault (hvac)
pip install dature[consul]     # Consul (py-consul)
pip install dature[etcd]       # etcd (etcd3gw)
pip install dature[zookeeper]  # Apache ZooKeeper (kazoo)
pip install dature[aws]        # AWS SSM & Secrets Manager (boto3)
pip install dature[azure-appconfig] # Azure App Configuration
pip install dature[azure-keyvault]  # Azure Key Vault
pip install dature[gcp]        # GCP Secret Manager
pip install dature[secure]     # Secret detection heuristics
pip install dature[type-stubs] # Type stubs for the integrations above (mypy/pyright users)

Quick Start

from dataclasses import dataclass

import dature


@dataclass
class Config:
    host: str
    port: int
    debug: bool = False


config = dature.load(dature.Yaml12Source(file="config.yaml"), schema=Config)

Key Features

  • Multiple sources — YAML, JSON, JSON5, TOML, INI, ENV, environment variables, Docker secrets, CLI args (argparse or your own), HashiCorp Vault, Consul, etcd, Apache ZooKeeper, AWS SSM, AWS Secrets Manager, Azure App Configuration, Azure Key Vault, GCP Secret Manager
  • Merging — combine multiple sources with configurable strategies ("last_wins", "first_wins", "raise_on_conflict")
  • Validation — Annotated field validators, root validators, __post_init__ support
  • Naming — automatic field name mapping (snake_case ↔ camelCase ↔ UPPER_SNAKE etc.)
  • Secret masking — automatic masking in error messages and logs by field type, name, or heuristic
  • ENV expansion — $VAR, ${VAR:-default} substitution in all file formats
  • Special types — SecretStr, ByteSize, PaymentCardNumber, URL, Base64UrlStr
  • Debug report — debug=True shows which source provided each field value
  • Decorator mode — @dature.load(meta) auto-loads config on dataclass instantiation with caching
  • CLI — dature validate and dature inspect console commands for CI and debugging
  • Cross-source refs & conditional sources — reference values across sources, activate sources based on environment
  • Extensible — plug in custom sources, type loaders, and remote backends via SourceProtocol

See the documentation for detailed guides and API reference.

Requirements

  • Python >= 3.12
  • adaptix >= 3.0.0b11

Development

git clone https://github.com/reagento/dature.git
cd dature
uv sync --all-extras --all-groups

Run tests:

uv run pytest tests/ -v

Lint and type check:

uv run prek run --all-files

Build docs locally:

uv run mkdocs serve

Changelog

Each PR must include a towncrier fragment in the changes/ directory:

# Format: changes/<issue-or-pr-number>.<type>
echo "Added support for YAML anchors." > changes/42.feature

Available <type> values:

Type Description
feature New features
bugfix Bug fixes
doc Documentation improvements
removal Deprecations and removals
misc Other changes

Use +<description> instead of an issue number for changes without a linked issue:

echo "Fixed typo in error message." > changes/+fix-typo.bugfix.md

Releasing

  1. Run the Release workflow and choose bump type (patch / minor / major). The next version is calculated from the latest git tag automatically.
  2. The workflow builds the changelog from fragments and creates a PR.
  3. Merge the PR — CI automatically creates the tag, publishes to PyPI, creates a GitHub Release, and updates docs.

License

Apache License 2.0

Metadata

Release files for dature 1.5.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 dature 1.5.0
File Size Uploaded
dature-1.5.0.tar.gz 567.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dature 1.5.0
File Interpreter ABI Platform
dature-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 785.6 kB

Release files / dature-1.5.0.tar.gz

Download URL dature-1.5.0.tar.gz
Size 567.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b129d42be460f143e2d0214047954a97829855f8f5870ccbfdccc93a3f6c566
BLAKE2b-256 checksum
How to use checksums
5108e7a5d57f2f6cdcc58667a442429dea3905dfdb86052fed28cbc2528bb452
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 / dature-1.5.0-py3-none-any.whl

Download URL dature-1.5.0-py3-none-any.whl
Size 218.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c6fab2c7d3b8947c96f3726bb86b47ea5bb23b77b2ac9064057d61d91a90471
BLAKE2b-256 checksum
How to use checksums
d1f9f5dbbefd3e84f0df7fd4d42879d12f8c4d4b206b1aadd84c98c48a4b2812
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

1.6.0

2 release files

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.22.4

2 release files

0.22.0

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.3

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.5

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

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