ezkfg
Easy Configuration
Installation
pip install ezkfg
Usage
Basic Usage
import ezkfg as ez
from ezkfg import Config
if __name__ == '__main__':
config = Config({"a": 1, "b": {"c": 2}, "z.y.x": 233}) # or ez.load("xxx")
assert config.a == 1
assert config.b.c == 2
assert config.z.y.x == 233
config.a = 3
assert config.a == 3
config["d.e.f"] = 3
assert config["d.e.f"] == 3
assert config.d.e.f == 3
config["e.f.g.h"] = 4
assert config.e.f.g.h == 4
assert config["e.f.g.h"] == 4
config.e["h.i.j"] = 5
assert config.e["h.i.j"] == 5
assert config.e.h.i.j == 5
assert config["e.h.i.j"] == 5
config["g.h.i.j"] = 7
assert config.g.h.i.j == 7
assert config["g.h.i.j"] == 7
config.load(["--model=resnet18", "--batch-size=32", "--lr=0.01"])
assert config.model == "resnet18"
assert config.batch_size == "32"
assert config.lr == "0.01"
config.dump('config.json') # support json, yaml, py, ini
config.load('config.json')
You can find more examples in tests.
Advanced Usage
Acknowledgements
This project is inspired by the addict, CHANfiG and mmdetection.
Metadata
Release files for ezkfg 0.1.2
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 |
|---|---|---|---|---|
| ezkfg-0.1.2.tar.gz | 11.1 kB | Without provenance | Details for ezkfg-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezkfg-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ezkfg-0.1.2-py3-none-any.whl |
Total release size: 23.1 kB
Release files / ezkfg-0.1.2.tar.gz
| Download URL | ezkfg-0.1.2.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
563fd1ebc160590741dcef95141c745499068bda3fb82cc5bafae4c9422fe4b0
|
|
BLAKE2b-256 checksum How to use checksums |
ec1fdb070224587f0885a8dd216ac6f22678310adf6d03287861a1e84b68b263
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / ezkfg-0.1.2-py3-none-any.whl
| Download URL | ezkfg-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b980bf0d546e82008878604138b9ec37c31856a72f67b09fb4011f1271410cb
|
|
BLAKE2b-256 checksum How to use checksums |
b57438387419ef624948cbea3705eb06cd8533ac92787117025ea7e714cabd3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for ezkfg 0.1.2
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.