configjy
Loads variables from a .json, .yaml or .yml file
Getting started
You can get configjy from PyPI,
which means it's easily installable with pip:
python -m pip install configjy
Example usage
from configjy import ConfigFile
# given this file:
"""
{
"key1": 10,
"key2": {
"key3": 20
},
"key4": "{{key1}}"
}
"""
fvar = ConfigFile(config_file_path)
key1 = fvar.get('key1')
print(key1) # 10
key2 = fvar.get('key2')
print(key2) # {"key3": 20}
key3 = fvar.get('key2.key3')
print(key3) # 20
key4 = fvar.get('key4')
print(key4) # str(key1) = "10"
key5 = fvar.get('key5', default=1, print_when_not_exists=False)
print(key5) # 1
try:
key6 = fvar.get('key6', raise_when_not_exists=True) # raises key error
except KeyError:
pass
key6 = fvar.get('key6') # print a warning abou non existent key
print(key6) # None
Changelog
Refer to the CHANGELOG.md file.
Metadata
Release files for configjy 0.1.0.6
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 | |
|---|---|---|---|---|
| configjy-0.1.0.6.tar.gz | 5.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| configjy-0.1.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.8 kB
Release files / configjy-0.1.0.6.tar.gz
| Download URL | configjy-0.1.0.6.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
736082f8d3cc4c7285b02ad6b4c838ec0b590e08aa7a566edb1e5dd5836bfc3d
|
|
BLAKE2b-256 checksum How to use checksums |
ed42888517a8fc5ec0fcd6f6cf9bed0edd810e8631047f9e52cc19e4779c6086
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
|
Release files / configjy-0.1.0.6-py3-none-any.whl
| Download URL | configjy-0.1.0.6-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aab520dbc58b917e7632301edd30f4ae912e10d91f4c03d9868f07f94071173d
|
|
BLAKE2b-256 checksum How to use checksums |
769d24bc89cfc4e1de73993f34506d119dcd06d50b29d9085051ba203725fe36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure
|
Security for configjy 0.1.0.6
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.