Welcome to BatConf
Configuration Management for Python projects, modules, applications, and microservices.
Compose structured hierarchical configurations from multiple sources. Enable your code to adapt seamlessly to the current context. Allow users in different contexts to use the config source that works best for them.
Hierarchical priority: CLI > Environment > config file > module defaults
Provides builtin support for common config sources:
CLI args
Environment Variables
Config File (ini, toml, yaml)
Config classes with default values
Fully customizeable configuration Schemas
Easily extendable, add new sources to serve your needs.
Set reasonable defaults, and override them as needed.
Designed for 12-factor applications (config via Environment Variables)
Free-Threading support!
Read about how BatConf supports free-threading/nogil in python 3.14+
Security
Read about how BatConf helps to protect you against supply chain attacks on our Developer’s Blog.
What’s new in v0.4.0
ConfigSingleton— share a single configuration instance across your applicationinsert_source()— add sources at runtime (e.g. after CLI arg parsing)Subscript access:
cfg['key']as an alternative tocfg.keyCleaner public API: import common classes directly from
batconf
See the Migration Guide guide for upgrade instructions.
Professional Support
Professionally supported BatConf is now available.
Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.
Contributing
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
Issues
Submit issues, feature requests or bugfixes on GitHub
License and Credits
batconf is licensed under the
MIT license.
and is written and maintained by Lundy Bernard (lundy.bernard@gmail.com)
and Lauren Moore