Python SDK for OpenDecree — schema-driven configuration management (alpha)
Project description
OpenDecree Python SDK
Python SDK for OpenDecree — schema-driven configuration management.
Alpha — This SDK is under active development. APIs and behavior may change without notice between versions.
Install
pip install opendecree
Quick Start
from opendecree import ConfigClient
with ConfigClient("localhost:9090", subject="myapp") as client:
# Get config values (default: string)
fee = client.get("tenant-id", "payments.fee")
# Typed gets via overload
retries = client.get("tenant-id", "payments.retries", int)
enabled = client.get("tenant-id", "payments.enabled", bool)
# Set values
client.set("tenant-id", "payments.fee", "0.5%")
Watch for Changes
with ConfigClient("localhost:9090", subject="myapp") as client:
with client.watch("tenant-id") as watcher:
fee = watcher.field("payments.fee", float, default=0.01)
enabled = watcher.field("payments.enabled", bool, default=False)
if enabled:
print(f"Current fee: {fee.value}")
@fee.on_change
def on_fee_change(old: float, new: float):
print(f"Fee changed: {old} -> {new}")
Async
from opendecree import AsyncConfigClient
async with AsyncConfigClient("localhost:9090", subject="myapp") as client:
val = await client.get("tenant-id", "payments.fee")
retries = await client.get("tenant-id", "payments.retries", int)
Documentation
For detailed concepts (schemas, typed values, versioning, auth), see the main OpenDecree docs.
Requirements
- Python 3.11+
- A running OpenDecree server (v0.3.0+)
License
Apache License 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opendecree-0.2.0a1.tar.gz.
File metadata
- Download URL: opendecree-0.2.0a1.tar.gz
- Upload date:
- Size: 66.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02c76a7d92ef7eb9aaa100c4d8e3fee2409386d38cca19987b6ee1e80a0aa82d
|
|
| MD5 |
54f9116b6ffac85b7fc6928c00da1ac5
|
|
| BLAKE2b-256 |
d9fd7a366e6830bd6437f0a6a36572ee300ef99d0b6cf00ef7c9cd53ebf5ed7a
|
Provenance
The following attestation bundles were made for opendecree-0.2.0a1.tar.gz:
Publisher:
publish.yml on opendecree/decree-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opendecree-0.2.0a1.tar.gz -
Subject digest:
02c76a7d92ef7eb9aaa100c4d8e3fee2409386d38cca19987b6ee1e80a0aa82d - Sigstore transparency entry: 1319763541
- Sigstore integration time:
-
Permalink:
opendecree/decree-python@18ed3a370ca2c0136d3abd8dfd03044bb2e5b38e -
Branch / Tag:
refs/tags/v0.2.0a1 - Owner: https://github.com/opendecree
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18ed3a370ca2c0136d3abd8dfd03044bb2e5b38e -
Trigger Event:
push
-
Statement type:
File details
Details for the file opendecree-0.2.0a1-py3-none-any.whl.
File metadata
- Download URL: opendecree-0.2.0a1-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e02ba9ff429ffe53c8070b7ba7c07c620315c1d30efa83c81a5369512aa76da4
|
|
| MD5 |
ddf1cd36647e0f7a5a5686504e83933d
|
|
| BLAKE2b-256 |
e2f9e76e55a3adeda569e5af9acd8315650a7e8812a6afdb9df204a6fbb93668
|
Provenance
The following attestation bundles were made for opendecree-0.2.0a1-py3-none-any.whl:
Publisher:
publish.yml on opendecree/decree-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opendecree-0.2.0a1-py3-none-any.whl -
Subject digest:
e02ba9ff429ffe53c8070b7ba7c07c620315c1d30efa83c81a5369512aa76da4 - Sigstore transparency entry: 1319763632
- Sigstore integration time:
-
Permalink:
opendecree/decree-python@18ed3a370ca2c0136d3abd8dfd03044bb2e5b38e -
Branch / Tag:
refs/tags/v0.2.0a1 - Owner: https://github.com/opendecree
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18ed3a370ca2c0136d3abd8dfd03044bb2e5b38e -
Trigger Event:
push
-
Statement type: