utility library to find and load configuration files
Project description
config-library
utility library to find and load configuration files
this project is undergoing major changes
Installation
pip install config-library
Supported Config-Types
- .json
- .jsonc
- .ini/.conf
- .toml (python3.11+ or
pip3 install config-library[toml]
) - .yaml (
pip3 install config-library[yaml]
)
Places to search for
/etc/
/home/<user>/
/path/to/git-repo/
/path/to/source/code/
And in these folder it searches for either directly the config file or a sub-folder that's named like your project.
Usage Example
import configlib
config = configlib.findAndLoad('app.conf', 'project')
system file-structure
/
├─ etc/
├─ home/user/
│ ├─ path/to/repo/
│ │ ├─ src/code/
│ │ │ ├─ main.py
│ ├─ .config/
places where config-library
searches for the config-file
- /home/user/path/to/repo/src/code/app.conf
- /home/user/path/to/repo/src/code/project/app.conf
- /home/user/path/to/repo/app.conf
- /home/user/path/to/repo/project/app.conf
- /home/user/.config/app.conf
- /home/user/.config/project/app.conf
- /etc/app.conf
- /etc/project/app.conf
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.
Source Distribution
config-library-0.3.0.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for config_library-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dcf70a24258b4821cb852acd7d8c69dbdf6843a94da8eae37b3c7a2cde47ac5 |
|
MD5 | 04461bc569fdb51050867580edb0058c |
|
BLAKE2b-256 | 62cf0b2f39d9e6a898d619712675892cf0d63d1fe7556c746f9e9882778cfa3d |