qpyconf is a small configuration helper built on top of:
dynaconffor loading and layering settings from files + environment variablespydanticfor validating and converting settings into typed models
It supports:
.envfiles (via Dynaconfload_dotenv)settings.toml(and other Dynaconf-supported formats like JSON/YAML/INI)- Dynaconf environments (e.g.
[default],[test]) with runtime switching
Docs:
uv add qpyconfpip install qpyconfCreate a settings.toml:
[default]
key = "value"
databases = { default = { url = "postgresql+psycopg://postgres:changeit@127.0.0.1:5432/workspace" } }
pg_url = "postgresql+psycopg://postgres:changeit@127.0.0.1:5432/workspace"
pg_a_url = "postgresql+psycopg_async://postgres:changeit@127.0.0.1:5432/workspace"
[test]
key = "abc"
databases.default.url = "postgresql+psycopg_async://postgres:changeit@127.0.0.1:5432/workspace"Read settings:
from qpyconf import settings
assert settings.key == "value"More examples:
uv sync
uv run ci