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.3.0a1.tar.gz (68.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.3.0a1-py3-none-any.whl (75.5 kB view details)

Uploaded Python 3

File details

Details for the file opendecree-0.3.0a1.tar.gz.

File metadata

  • Download URL: opendecree-0.3.0a1.tar.gz
  • Upload date:
  • Size: 68.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.3.0a1.tar.gz
Algorithm Hash digest
SHA256 321955444ab5fd1c1f2349bdcb602f24d9f15aea6fc38d7a862a770ebbb8fa66
MD5 7e041c7b7d054acd12ef725cb29cbfaf
BLAKE2b-256 002e9bc75336c0b1643a45ca7560a60115f95d0bfc2f16181efec886079a6802

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendecree-0.3.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.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: opendecree-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 75.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.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 028bb40a7581fc342844af2f4c0d85e5b57a16202e9f267311cdd7bd177a83d8
MD5 84b85d9f861b335238de60734dd30398
BLAKE2b-256 61b7abec3191f0351ee61735efed4c8a677631d35089ecb92d02c743983463cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for opendecree-0.3.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