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

Full documentation, including guides and the API reference, is published at opendecree.github.io/decree-python:

  • Connecting — client options (auth, TLS, retry, timeouts, error handling)
  • Watching — live subscriptions and change patterns
  • Async Usage — async client and watcher
  • API Reference — full auto-generated API docs

For detailed concepts (schemas, typed values, versioning, auth), see the main OpenDecree docs.

Typing

This package is fully typed. It ships a py.typed marker and .pyi stub files for the generated gRPC layer, so mypy, pyright, and similar tools work without additional configuration.

Requirements

  • Python 3.11+
  • A running OpenDecree server (v0.8.0 – v0.x, pre-1.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.4.0a1.tar.gz (91.3 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.4.0a1-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for opendecree-0.4.0a1.tar.gz
Algorithm Hash digest
SHA256 f6b90d266d94e9aa3ab8c1faa4c05138f44c38296bf568fb0e8261ced694836b
MD5 56d1e6dd9ec9a772e7afe2c27a4824a6
BLAKE2b-256 b2966ac217f6b0cb5b9f865f57d323c6c2c403352aab9faef1e6233439c8d42a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: opendecree-0.4.0a1-py3-none-any.whl
  • Upload date:
  • Size: 88.8 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.4.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c43b3e63bc040d6711f9a5c1b85a30a6d539db5b91fa493a73a53e0ef60c7b
MD5 5d5eb394d23d50c8c670429d1a2c936b
BLAKE2b-256 efd7053d721414b8bf7cd6fc6c4ff91063d9235c312b8f60fd7ebfacff02aebf

See more details on using hashes here.

Provenance

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