A simple, yet capable configuration library for Python
Project description
pyfig
A Python configuration system that's powerful enough to meet complex requirements, while being simple enough so new contributors to your software can confidently make changes without worrying how to get everything setup.
Features
- 📂 Hierarchical overrides
- ✅ Validation powered by pydantic
- 📝 Extensible templating for variables
- 🛠️ Types, defaults, validation, and docs: all in one place directly in your code
Note: pyfig does not inherently support changes to the config at runtime. This feature is not planned.
Installation
pip install jpyfig
Requirements
Strictly, only pydantic is required.
To make full use of the all features, you may also need some of:
These can be independently installed as necessary.
Usage
- Install pyfig
- Create a class tree of subclasses of
Pyfig
(*). Provide all attributes, types, docs, and defaults in your.py
's - Create overriding configs that can be applied hierarchically based on your requirements
- Load your configuration:
- Using either the built-in 'metaconf' feature, or
- By creating your own implementation and calling
pyfig.load_configuration(...)
appropriately
Tutorial
There is a small tutorial ready to walk you through the features and patterns when using Pyfig. Click me
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.