This release is a pre-release and may not be stable for production use.
Python Viper
This project was inspired by spf13/viper.
Installation
pip install py-viper
Usage
import tempfile
import viper
yaml_example = b'''
hello:
name: foo
'''
class Hello:
name = ''
class Config:
hello = Hello
if __name__ == '__main__':
with tempfile.NamedTemporaryFile(suffix='.yaml') as temp:
temp.write(yaml_example)
temp.seek(0)
viper.set_config_path(temp.name)
viper.read_config()
assert viper.get('hello.name') == 'foo'
conf = Config()
viper.unmarshal(conf)
assert conf.hello.name == 'foo'
You can also use remote config instead of local config:
viper.set_config_type('yml')
viper.set_remote_provider('consul', '127.0.0.1', 8500, 'hello')
viper.read_remote_config()
Note:
- The config type only supports yaml or yml.
- The backend of remote config only supports consul.
TODO
- Read remote config
- Unmarshal config
- Add support for JSON
Metadata
Release files for py-viper 0.1.0.dev5
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 |
|---|---|---|---|---|
| py-viper-0.1.0.dev5.tar.gz | 4.1 kB | Without provenance | Details for py-viper-0.1.0.dev5.tar.gz |
Release files / py-viper-0.1.0.dev5.tar.gz
| Download URL | py-viper-0.1.0.dev5.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b485c6f3b76bf41b02441c700764dace29600310792523334312435cdb1c726f
|
|
BLAKE2b-256 checksum How to use checksums |
158671bf66f4e71bfa754889651c7bf9b38d8c728fcbb3fd8654bd300a33448e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
|
Security for py-viper 0.1.0.dev5
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.