etcd-dynamic-config
Python library for managing etcd-based configurations with caching and real-time updates.
Installation
pip install etcd-dynamic-config
Quick Start
Basic Usage
from etcd_dynamic_config import BaseEtcdClient
# Create client
client = BaseEtcdClient(
endpoint=os.getenv("EtcdSettings__HostName"),
username=os.getenv("EtcdSettings__UserName"),
password=os.getenv("EtcdSettings__Password"),
root_key=os.getenv("EtcdSettings__RootKey", "/APPS/ControlUnit"),
use_snake_case=True, # transform values that we got under rootkey to python format
auto_discover_keys=True, # search those values, if stated False you should redifine _build_etcd_key_map method
)
# Get configuration
config = client.get_config()
# Use values
api_url = config.get('categorization_api_url')
db_dsn = config.get('postgres_dsn')
Async Usage
import asyncio
from etcd_dynamic_config import EtcdConfig, ControlUnitEtcdClient
async def main():
client = ControlUnitEtcdClient()
config_manager = EtcdConfig(client=client)
await config_manager.start()
configs = await config_manager.get_all_configs()
await config_manager.stop()
asyncio.run(main())
Environment Variables
Set these to configure etcd connection:
export EtcdSettings__HostName="http://localhost:2379"
export EtcdSettings__UserName="username"
export EtcdSettings__Password="password"
export EtcdSettings__RootKey="/APPS/ControlUnit"
Features
- In-memory caching for fast access
- Real-time updates via etcd watch
- Automatic type coercion (bool, int, float, tuple)
- Snake case conversion (CamelCase → snake_case)
- Environment variable fallback
- Thread-safe operations
Metadata
Release files for etcd-dynamic-config 0.2.4
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 |
|---|---|---|---|---|
| etcd_dynamic_config-0.2.4.tar.gz | 16.9 kB | Without provenance | Details for etcd_dynamic_config-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| etcd_dynamic_config-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for etcd_dynamic_config-0.2.4-py3-none-any.whl |
Total release size: 35.5 kB
Release files / etcd_dynamic_config-0.2.4.tar.gz
| Download URL | etcd_dynamic_config-0.2.4.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be9d48df8532dca806b9b022fe44ac1c67d76a9c0ba5872ae83629b4229650ac
|
|
BLAKE2b-256 checksum How to use checksums |
10d3aab4f69cb4543de9027277daf8c4de63257d6433bd69e8bc5327dfc23392
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / etcd_dynamic_config-0.2.4-py3-none-any.whl
| Download URL | etcd_dynamic_config-0.2.4-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
094685cb28ef4c3244e6d6afa2bccff593545bd7583024411ac81c506aeedd23
|
|
BLAKE2b-256 checksum How to use checksums |
083771a2771dc28b6f9b68317ec483d83448e495c4df09e23fcced614d45e559
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for etcd-dynamic-config 0.2.4
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.