Yamz
An easy way to manage environment specific configurations.
Requirements
- Python >=3.6
Why Yamz?
All the other names I managed to think of were already taken, so... here we are.
How to use
I recommend using environments names such as: production, development, etc.,
Also, if you would like to include variables from your environment, make sure to add a $ prefix ($HOME) and Yamz will make sure it's included.
Note: global settings will be available in all environments
pip install yamz- Configure your environment in
config.yaml(requires PyYAML)global: TEST: some_test production: HOME: $HOME MYSQL_DB_HOST: 1.2.3.4 MYSQL_DB_PASS: $MYSQL_DB_PASS
- Configure your environment in
config.json{ "global": { "TEST": "some_test" }, "production": { "HOME": "$HOME", "MYSQL_DB_HOST": "1.2.3.4", "MYSQL_DB_PASS": "$MYSQL_DB_PASS" } }
import os
from yamz import Yamz
from yamz.providers.default import YamlProvider, JsonProvider
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path = os.path.join(base, 'config.yaml')
env = Yamz(path, provider=YamlProvider) # or JsonProvider
prod_env = env.load("production")
prod_env.MYSQL_DB_HOST # 1.2.3.4
prod_env.YAMZ_ENV # production
Contributions
If you'd like to contribute and make Yamz better, feel free to open up a PR. I'll review it at my earliest convenience!
Metadata
Release files for yamz 0.2.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 |
|---|---|---|---|---|
| yamz-0.2.2.tar.gz | 3.5 kB | Without provenance | Details for yamz-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yamz-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for yamz-0.2.2-py3-none-any.whl |
Total release size: 9.2 kB
Release files / yamz-0.2.2.tar.gz
| Download URL | yamz-0.2.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63c843568aab751ab01a97f85e38d5478e6bf4382fd2b7935c581bca33cb0fe7
|
|
BLAKE2b-256 checksum How to use checksums |
102ace285d24c6979cba1bbc4b2382362079eec0b9890baf9cc5bfc5e9f8facf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
|
Release files / yamz-0.2.2-py3-none-any.whl
| Download URL | yamz-0.2.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a5ccc42ecf20b74fc417f50e97f2d4e35130ed6d1779dc7661337b610859ac7
|
|
BLAKE2b-256 checksum How to use checksums |
91351723cf573bfb2981e753befe94b54e675625dd865976d1c2f3a91c5b2dc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
|
Security for yamz 0.2.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.