dhagrow/profig ↗
Created Dec 27, 2020 · View the dhagrow/profig repository page
A straightforward configuration library for Python.
Want this for your repo?
Render a free sample of any GitHub repo in seconds.
Contributors
5
Lines of Code
592
From
Jun 8, 2013
To
Dec 1, 2019
About dhagrow/profig
Profig is a lightweight configuration library for Python that prioritizes simplicity and ease of use. It handles loading and managing configuration files without requiring any external dependencies, making it ideal for projects that want to keep their dependency footprint minimal. The library automatically converts values to appropriate types, supports nested sections for organizing related settings, and provides intuitive dict-like access to configuration values.
The library supports multiple configuration formats including INI files and Windows registry entries, with extensibility built in for adding custom formats. When working with INI files, profig preserves the original file structure including comments and ordering, which is useful when configuration files are edited both programmatically and manually. It offers full Unicode support and maintains compatibility with Python 2.7 through Python 3.2 and later versions.
Users define configuration schemas by initializing expected keys with default values and types, then call a sync method to load values from the actual configuration file. The straightforward API allows accessing settings either through dot notation paths like 'server.host' or by first retrieving a section and then accessing its keys, giving developers flexibility in how they interact with their configuration data.