Skip to main content

Python SDK for OpenDecree — schema-driven configuration management

Project description

OpenDecree Python SDK

CI PyPI Python Coverage License

Python SDK for OpenDecree — schema-driven configuration management.

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.1.0.tar.gz (65.7 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.1.0-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

Details for the file opendecree-0.1.0.tar.gz.

File metadata

  • Download URL: opendecree-0.1.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opendecree-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74b4c338ac8f46aecc48feb82ade5e2a8d95dc4d50391790221be73579b7a95a
MD5 04f274cf4d81e45c133d46f6747f63f5
BLAKE2b-256 d209c7adebf8fff522d44fc9ff0ddcbe7eca2f66aff161061ad5041e0463c028

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on zeevdr/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.1.0-py3-none-any.whl.

File metadata

  • Download URL: opendecree-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 72.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cc7a683f596929209bb8b1f773be2ccd604181a75007ce4cfa772f148a43334
MD5 67bebd5ca2726b5fccbd8f12e440a939
BLAKE2b-256 cce29dc65e90089fb9f1ca90b7e071e3864de66b20f4ef48e891106330118215

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on zeevdr/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