Pretty Conf is a Python library created to make easy the separation of configuration and code following the recommendations of 12 Factor's topic about configs.
It is strongly inspired in python-decouple and both provides a similar API. It is framework agnostic and works the same way under Django, Flask, FastAPI or a plain command line script.
Installation
pip install prettyconf
The AwsParameterStore loader depends on boto3. Install the optional
aws feature if you need it:
pip install prettyconf[aws]
prettyconf requires Python 3.10 or newer.
Documentation
You can find prettyconf documentation at Read the Docs website.
Development
The project uses uv and a Makefile as its entry point. make setup
bootstraps everything, installing uv first if it is missing:
make setup
The remaining targets are listed by make help:
make test |
run the test suite (ARGS="-k name" to filter) |
make test-all |
run the test suite on every supported python |
make coverage |
run the test suite with a coverage report |
make lint |
check the code with ruff |
make format |
reformat and auto-fix the code with ruff |
make typecheck |
check the types with ty |
make docs |
build the HTML documentation |
make build |
build the sdist and the wheel |
make update-deps |
upgrade every dependency and refresh uv.lock |
Any target accepts a PYTHON variable to run against another supported
interpreter, each one in its own virtualenv:
make test PYTHON=3.10Pull requests should keep make lint, make typecheck and make test
passing, and should describe the change well enough that a reviewer does not
need to open the linked issue. Releases are published to PyPI by GitHub
Actions when a GitHub release is created, which is what make release does.