Skip to main content
https://travis-ci.com/alexferl/distconfig.svg?branch=master Documentation Status

distconfig3

This is a fork of distconfig removing Python 2.7 support as well as six and ujson dependencies.

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 distconfig3 using

$ pip install distconfig3[zookeeper]

with etcd:

$ pip install distconfig3[etcd]

with consul:

$ pip install distconfig3[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

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:

Metadata

Release files for distconfig3 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for distconfig3 1.0.1
File Size Uploaded
distconfig3-1.0.1.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for distconfig3 1.0.1
File Interpreter ABI Platform
distconfig3-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 31.5 kB

Release files / distconfig3-1.0.1.tar.gz

Download URL distconfig3-1.0.1.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7d2c7f30a57ef494c5683270587ba7593318746c6e22b9b8953e288c9c303c65
BLAKE2b-256 checksum
How to use checksums
f69e5d46d30668e353b618a00bdeb704cd6fa55e64cc902078e49cdd22874487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.9.0

Release files / distconfig3-1.0.1-py2.py3-none-any.whl

Download URL distconfig3-1.0.1-py2.py3-none-any.whl
Size 19.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
823e35ae044677e8aa77bed8d9be0780862a2500c63cf95ce85544b9d3d9fc89
BLAKE2b-256 checksum
How to use checksums
15687258f0df8576bd1709a481b96f56a46cd5894bd075b79ccfd233e86ff395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page