Skip to content

python simple configuration lib based on dynconf

Notifications You must be signed in to change notification settings

fluent-qa/qpyconf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qpyconf

ci coverage

qpyconf is a small configuration helper built on top of:

  • dynaconf for loading and layering settings from files + environment variables
  • pydantic for validating and converting settings into typed models

It supports:

  • .env files (via Dynaconf load_dotenv)
  • settings.toml (and other Dynaconf-supported formats like JSON/YAML/INI)
  • Dynaconf environments (e.g. [default], [test]) with runtime switching

Docs:

Install

uv add qpyconf
pip install qpyconf

Quickstart

Create 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:

Development

uv sync
uv run ci

About

python simple configuration lib based on dynconf

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages