Smart Settings
A nifty little wrapper around settings files. Particularly useful for cluster utils.
Run to install:
python3 -m pip install al-smart-settings
Main features
-
Supports JSON, YAML and TOML files.
-
Duplicate check. Duplicate keys in JSONs are caught and raise an exception.
-
Objectification The resulting objects support dot access. By default they are immutable (but a mutable copy can be exported).
-
Imports It allows for importing other JSON files with arbitrary level of nesting and recursion. Imports are carried out from the most nested and NEVER overwrite present values.
-
Dynamic values Some values may be "computed" dynamically based on other content of the JSON (after all imports are performed). This includes access to environmental variables (present in
os.environ).
API for changing keys in many files
python3 -m smart_settings.change_key settings/*.json train_params.opt_params optimizer_params
--> Changes train_params.opt_params to train_params.optimizer_params in every file matching the wildcard
python3 -m smart_settings.add_key settings/*.json train_params.num_epochs 10 --override
--> Adds key train_params.num_epochs with value 10. --override controls overwriting of present values
python3 -m smart_settings.port_cluster_utils_3 settings/**/*.json
--> Performs all name changes required for porting to cluster_utils >=3.0
Examples
See the examples folder
Metadata
Release files for al-smart-settings 1.2.0
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 | |
|---|---|---|---|---|
| al_smart_settings-1.2.0.tar.gz | 6.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| al_smart_settings-1.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / al_smart_settings-1.2.0.tar.gz
| Download URL | al_smart_settings-1.2.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a9d3dfc3d8bb228191d1e119f81bd099acf105ca153ec63a0da6ffade35e317
|
|
BLAKE2b-256 checksum How to use checksums |
dea64e44991ecfee816ec84e4c0e42deefb6a614a54db9bce0ce8089ebc71780
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / al_smart_settings-1.2.0-py2.py3-none-any.whl
| Download URL | al_smart_settings-1.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c98e69817aa73455ee52c01fecf4a58f81d8ea2cc1244e784236102413952155
|
|
BLAKE2b-256 checksum How to use checksums |
061443a6aaf7c63a7fe6d6b7ba6511fa9bb51999a726a18213678c3175a88892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Security for al-smart-settings 1.2.0
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.