Python client SDK for Konfigo Realtime Config
Project description
Konfigo Python SDK
Python client SDK for Konfigo Realtime Config. It mirrors the .NET SDK concepts:
- config groups and keys are declared with decorators;
- class/key schemas are discovered and sent to the backend as a version;
- config values are stored as string entries with per-key generations;
- stale and equal-generation updates are ignored;
- subscription events with generation
1are treated as initial state and do not overwrite the already loaded snapshot.
Install
pip install -e .
For the gRPC adapter, install the grpc extra — the service_pb2 / service_pb2_grpc modules are pre-generated from protos/service.proto and ship with the package:
pip install -e ".[grpc]"
Declaring Options
from dataclasses import dataclass
from konfigo import config_group, config_key
@config_group(key="Payments", group_name="Payments", description="Payment gateway")
@dataclass
class PaymentsOptions:
provider: str = config_key(default_value="Stripe")
timeout_seconds: int = config_key(default_value="30")
Runtime Usage
from konfigo import KonfigoClient, RealtimeConfigOptions, bind_config, discover_definitions
from konfigo.grpc_transport import GrpcRealtimeConfigTransport
options = RealtimeConfigOptions(
is_enabled=True,
service_id="orders",
version="1.0.0",
url="realtime-config.internal:443",
)
transport = GrpcRealtimeConfigTransport(options.url)
definitions = discover_definitions(PaymentsOptions)
client = await KonfigoClient.create(
options=options,
transport=transport,
definitions=definitions,
)
task = client.start_background_task()
payments = bind_config(client.store.snapshot(), PaymentsOptions)
Framework integrations can subscribe to client.store.subscribe(...) and rebind dataclasses when values change.
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 konfigo-0.0.5.tar.gz.
File metadata
- Download URL: konfigo-0.0.5.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cd120598a3ee9a943fce2bca08552d66c4ba2427e65f38b57b43be47d3c03ea
|
|
| MD5 |
8aa85a70f80208b3f5dfc643d0e14a93
|
|
| BLAKE2b-256 |
edfce2df2ea8aba8cac4fdfa9453b6177047baca0c2c47e5b990d4644db31f40
|
Provenance
The following attestation bundles were made for konfigo-0.0.5.tar.gz:
Publisher:
ci.yml on maximiliysiss/konfigo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
konfigo-0.0.5.tar.gz -
Subject digest:
6cd120598a3ee9a943fce2bca08552d66c4ba2427e65f38b57b43be47d3c03ea - Sigstore transparency entry: 1922080102
- Sigstore integration time:
-
Permalink:
maximiliysiss/konfigo@c728d21d90b32a72e99300335ce2a2d44df58b2d -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/maximiliysiss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c728d21d90b32a72e99300335ce2a2d44df58b2d -
Trigger Event:
release
-
Statement type:
File details
Details for the file konfigo-0.0.5-py3-none-any.whl.
File metadata
- Download URL: konfigo-0.0.5-py3-none-any.whl
- Upload date:
- Size: 14.9 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 |
5240f3729967a1088c7f7bcd45c9929be30b6ca41816a952688f700354492039
|
|
| MD5 |
0cb292e9bfe41ab473e69a325b59e572
|
|
| BLAKE2b-256 |
8cc8e208c66bb016c0147dbb4b2d472d8ab0bbc33ca7dbf21e1ddeb0924dd15c
|
Provenance
The following attestation bundles were made for konfigo-0.0.5-py3-none-any.whl:
Publisher:
ci.yml on maximiliysiss/konfigo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
konfigo-0.0.5-py3-none-any.whl -
Subject digest:
5240f3729967a1088c7f7bcd45c9929be30b6ca41816a952688f700354492039 - Sigstore transparency entry: 1922080227
- Sigstore integration time:
-
Permalink:
maximiliysiss/konfigo@c728d21d90b32a72e99300335ce2a2d44df58b2d -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/maximiliysiss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c728d21d90b32a72e99300335ce2a2d44df58b2d -
Trigger Event:
release
-
Statement type: