distconfig
Library to manage distributed configuration using either ZooKeeper or Etcd or Consul.
Rational
When you have to manage configuration of a given services that are distributed across nodes, you may want to consider using either one of the distributed configuration managers e.g. zookeeper, etcd, consul …, this library goal is to give developers an easy access to configuration stored in the previous backends.
Installation:
To use ZooKeeper as backend you should install distconfig using
$ pip install distconfig[zookeeper]
with etcd:
$ pip install distconfig[etcd]
with consul:
$ pip install distconfig[consul]
Usage:
Example using zookeeper as a backend
from kazoo import client
from distconfig import Proxy
client = client.KazooClient()
# The user must call ``KazooClient.start()`` before using this particular
# backend
client.start()
proxy = Proxy.configure(
'distconfig.backends.zookeeper.ZooKeeperBackend',
client=client,
)
# config is a read only mapping-like object.
config = proxy.get_config('/distconfig/service_name/config')
print config['key']
# Getting nested values works by supplying key seperated by '/' char.
print config['key/inner']
# You can assert key value type by using typed get function e.g.
# get_int, get_float, get_unicode, get_bytes ... .
print config.get_int('key/inner/int_key')
# Getting a inner config.
print config.get_config('key/inner/dict_key')
Development:
Start by installing dependencies
$ pip install -r requirements/dev.txt requirements/base.txt
To run unit test use tox
$ tox
To run integration test, we recommend you to install docker and then run
$ ./run-tests.sh
The above script will setup docker container for each of the backend and run the integration tests on them.
TODO:
Add file as a backend (use https://pypi.python.org/pypi/watchdog)
Metadata
Release files for distconfig 0.1.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 | Actions |
|---|---|---|---|---|
| distconfig-0.1.0.tar.gz | 10.5 kB | Without provenance | Details for distconfig-0.1.0.tar.gz |
Release files / distconfig-0.1.0.tar.gz
| Download URL | distconfig-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fa636bd561cc9dd1c76817f42ccff6a663e19e4a53dfe7ca11cbfc44e9f3416
|
|
BLAKE2b-256 checksum How to use checksums |
79c90382bb4247429e9bc1952318be4ab8a293328b830bc0fc64a2e83380d46a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for distconfig 0.1.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.