Configura is a Python configuration library that enables you to convert a folder of .json files into an easily accessible configuration folder.
Project description
Configura
Configura is a Python configuration library that enables you to convert a folder of .json files into an easily accessible configuration folder.
Usage
Say you have a folder with the following structure:
config_folder /
main.json
server.json
misc.json
You can use configura to access those configurations like so:
from configura import config
# Optionally, set your config folder here
# base_path defaults to "./config" so if your folder is named config, you don't have to modify this at all
config.base_path = "./config_folder"
# Print a misc.json as a dictionary
print(config.misc)
...
# Access data inside the misc.json as a dictionary
print(config.misc["model"])
LICENSE
MIT License
Copyright (c) 2023 Philippe Mathew
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without plimitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
File details
Details for the file configura-0.1.tar.gz
.
File metadata
- Download URL: configura-0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74fc1a6e346650bfbc987f43e6e73b89e99f6030795346e718b8c1a60081fe9d |
|
MD5 | 3d71a4ab7822714a3caf521b9bde9ef1 |
|
BLAKE2b-256 | 019ed4d62814013e42d34f96fa29cbdb7325275e7a70d9a7c51281b8268d880c |