Simple out-of-box configs
Project description
cfgmgr
Simple out of the box configurations for python projects
Basic usage
import cfgmgr
cfgmgr.make_config(env_prefix="CFG_", file_path="config.json", find_file=True)
some_val = cfgmgr.get('key')
cfgmgr.set('key', 'new_val')
make_config
- Initializes a global
Configas per args specified - Pass in
env_prefixto read values from environment variablesenv_prefixwill be prefixed to the keys before reading the environment variable- Ex.
env_prefix="CFG_"will effectively translatecfgmgr.get('foo')toos.getenv('CFG_foo')
- Values are resolved dynamically, so
cfgmgr.getwill respect environment variables set viaos.environ(Useful in test cases) file_pathattempts to resolve the extension and defers to the corresponding loader- JSON support is present. TOML, YAML and dotenv are planned.
- Custom Loaders can be implemented and registered via a decorator
cfgmgr.fileloaders.register('.extension')
find_file, ifTrue, will crawl upwards fromcwduntil it finds a match forfile_path
get and set
- Getter and Setter for the global default
Configobject raise AttributeErrorifmake_confighas not been called prior to aget/setcall
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfg_mgr-0.2.0.tar.gz.
File metadata
- Download URL: cfg_mgr-0.2.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5b05e1af688f3bb07ac77055d58911cde63c29533dc09e91c3e1914d3cf463a
|
|
| MD5 |
f515b646c2f05348985d4dd1b90d2672
|
|
| BLAKE2b-256 |
5389e5aa5c98fff3509e9706a85469436c12750442d79b7806d97ddcc2300b5f
|
Provenance
The following attestation bundles were made for cfg_mgr-0.2.0.tar.gz:
Publisher:
release.yml on raghavj98/cfgmgr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfg_mgr-0.2.0.tar.gz -
Subject digest:
d5b05e1af688f3bb07ac77055d58911cde63c29533dc09e91c3e1914d3cf463a - Sigstore transparency entry: 1553464089
- Sigstore integration time:
-
Permalink:
raghavj98/cfgmgr@73f8d4bde002f14ea05798688321c2aea43ff614 -
Branch / Tag:
refs/tags/rel-v0.2 - Owner: https://github.com/raghavj98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@73f8d4bde002f14ea05798688321c2aea43ff614 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cfg_mgr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cfg_mgr-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bb00ac3ea3a30e72d8a10c09b00c3050f13345bc2fa24fbb1e6d02223f046d1
|
|
| MD5 |
ed7323a780a8f73166354a2c3dbba56b
|
|
| BLAKE2b-256 |
94eef6a889fceecfbd534b43cc1bc0d69a63dfd12aa86a1b48702066ad9b26d1
|
Provenance
The following attestation bundles were made for cfg_mgr-0.2.0-py3-none-any.whl:
Publisher:
release.yml on raghavj98/cfgmgr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cfg_mgr-0.2.0-py3-none-any.whl -
Subject digest:
3bb00ac3ea3a30e72d8a10c09b00c3050f13345bc2fa24fbb1e6d02223f046d1 - Sigstore transparency entry: 1553464098
- Sigstore integration time:
-
Permalink:
raghavj98/cfgmgr@73f8d4bde002f14ea05798688321c2aea43ff614 -
Branch / Tag:
refs/tags/rel-v0.2 - Owner: https://github.com/raghavj98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@73f8d4bde002f14ea05798688321c2aea43ff614 -
Trigger Event:
push
-
Statement type: