Skip to main content

Python SDK for OpenDecree — schema-driven configuration management (alpha)

Project description

OpenDecree Python SDK

CI PyPI Python Coverage License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opendecree-0.2.0a1.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendecree-0.2.0a1-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

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

Hashes for opendecree-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 02c76a7d92ef7eb9aaa100c4d8e3fee2409386d38cca19987b6ee1e80a0aa82d
MD5 54f9116b6ffac85b7fc6928c00da1ac5
BLAKE2b-256 d9fd7a366e6830bd6437f0a6a36572ee300ef99d0b6cf00ef7c9cd53ebf5ed7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendecree-0.2.0a1.tar.gz:

Publisher: publish.yml on opendecree/decree-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for opendecree-0.2.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e02ba9ff429ffe53c8070b7ba7c07c620315c1d30efa83c81a5369512aa76da4
MD5 ddf1cd36647e0f7a5a5686504e83933d
BLAKE2b-256 e2f9e76e55a3adeda569e5af9acd8315650a7e8812a6afdb9df204a6fbb93668

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendecree-0.2.0a1-py3-none-any.whl:

Publisher: publish.yml on opendecree/decree-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page