Thumos Configr
A simple Python3 class to facilitate easy loading and access to configuration settings using dot-style syntax, with support for Yaml, JSON, TOML and XML. To clarify, dot-style syntax refers to something such as the following:
Example YAML file:
configuration:
mysql:
host: localhost
port: 3600
Using Configr, the values could be accessed in this way:
from configr import Configr
cr = Configr("config.yaml")
cr["configuration.mysql.host"]
>> localhost
cr["configuration.mysql.port"]
>> 3600
You may ask why one would want to use this instead of simply using a dictionary. The answer is; why not? Perhaps it's more convenient, more appealing to the eyes, or perhaps you're even coming from something like Spring Boot where this is the way it's usually done.
However, other characters than the dot can be used as a separator.
cr = Configr("config.yaml", separator="/")
cr["configuration/mysql/host"]
>> localhost
It is also possible to set an initial root key, to minimize verbosity when using deep configuration files that may contain settings not pertinent to the script or application you are working on. Take the following example YAML file:
this:
is:
nothingInteresting: Jimmy With A Law Degree Is Like A Chimp With A Machine Gun.
really:
fantastically:
deep: Is it not?
absolutely:
annoying: Indeed
cr = Configr("config.yaml", root_key="this.is.really")
cr["fantastically.deep"]
>> Is it not?
cr["absolutely.annoying"]
>> Indeed
Installation
pip install thumos-configr
Import like this:
from configr import Configr
Metadata
Release files for thumos-configr 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thumos-configr-0.0.5.tar.gz | 14.8 kB | Without provenance | Details for thumos-configr-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thumos_configr-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for thumos_configr-0.0.5-py3-none-any.whl |
Total release size: 29.8 kB
Release files / thumos-configr-0.0.5.tar.gz
| Download URL | thumos-configr-0.0.5.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6cb1fb3e53f76aa7f9cd5d8ec4f077ec2917e820b4b3e537c2f8e6096fb23ef
|
|
BLAKE2b-256 checksum How to use checksums |
c15ef8b4f03a2889a70f025849a49a5002439aad595c997d259a9d4835782af1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / thumos_configr-0.0.5-py3-none-any.whl
| Download URL | thumos_configr-0.0.5-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67ca3d9fc5c7c51eb0ca6412ff141cd2c720666c60b74ea813bc373b15d0c63b
|
|
BLAKE2b-256 checksum How to use checksums |
7f3020371ddc3899cfd9ba23093bcbd313f53d193794e30607a10f2c63fb89cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for thumos-configr 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.