Skip to main content

quonfig-openfeature

OpenFeature provider for Quonfig -- Python server-side SDK.

This package wraps the quonfig native SDK and implements the OpenFeature Python server-side AbstractProvider interface.

Install

pip install quonfig-openfeature quonfig openfeature-sdk

Usage

from openfeature import api
from openfeature.evaluation_context import EvaluationContext
from quonfig_openfeature import QuonfigProvider

provider = QuonfigProvider(
    sdk_key="qf_sk_production_...",
    # targeting_key_mapping="user.id",  # default
)

api.set_provider_and_wait(provider)
client = api.get_client()

# Boolean flag
enabled = client.get_boolean_value("my-feature", False)

# String config
welcome = client.get_string_value("welcome-message", "Hello!")

# Number config
timeout_ms = client.get_integer_value("request-timeout-ms", 5000)

# Object config (JSON or string_list)
allowed_plans = client.get_object_value("allowed-plans", [])

# With evaluation context (per-request)
is_pro = client.get_boolean_value(
    "pro-feature",
    False,
    EvaluationContext(
        targeting_key="user-123",          # maps to user.id by default
        attributes={
            "user.plan": "pro",
            "org.tier": "enterprise",
        },
    ),
)

Context mapping

OpenFeature context is flat; Quonfig context is nested by namespace. This provider maps between them using dot-notation:

OpenFeature context key Quonfig namespace Quonfig property
targeting_key user id (configurable via targeting_key_mapping)
"user.email" user email
"org.tier" org tier
"country" (no dot) "" (default) country
"user.ip.address" user ip.address (first dot only)

Customizing targeting_key mapping

provider = QuonfigProvider(
    sdk_key="qf_sk_...",
    targeting_key_mapping="account.id",  # maps targeting_key to {account: {id: ...}}
)

Accessing native SDK features

The get_client() escape hatch returns the underlying quonfig.Quonfig client for features not available in OpenFeature:

native = provider.get_client()

# Log level integration
should_log = native.should_log(
    config_key="log-level.auth",
    desired_level="DEBUG",
    contexts={"user": {"id": "user-123"}},
)

# List all config keys
keys = native.keys()

What you lose vs. the native SDK

OpenFeature is designed for feature flags, not general configuration. Some Quonfig features require the native quonfig SDK:

  1. Log levels -- should_log() is native-only.
  2. string_list configs -- accessed via get_object_value(), returned as a Python list[str].
  3. duration configs -- get_string_value() returns the stored ISO 8601 text unchanged ("PT90S"); a malformed stored duration returns your default with PARSE_ERROR. For seconds, use get_client().get_duration(). get_float_value() on a duration config returns your default with TYPE_MISMATCH.
  4. bytes configs -- not accessible via OpenFeature (no binary type in OF).
  5. keys() and raw config access -- native-only via get_client().
  6. Context keys use dot-notation -- "user.email", not nested objects.
  7. targeting_key maps to user.id by default -- configure targeting_key_mapping if different.

Startup failure and provider events

Extra keyword arguments go to the native quonfig.Quonfig constructor, so the SDK's init options pass straight through:

provider = QuonfigProvider(
    sdk_key="qf_sk_production_...",
    on_init_failure="fail",  # default; or "wait" / "continue"
    init_timeout_ms=10_000,  # default
)

initialize() blocks until the first config loads (up to init_timeout_ms). Provider status follows the outcome:

SDK on_init_failure Outcome Provider status Later
any config loaded READY
"fail" no config by the timeout ERROR: initialize() raises ProviderNotReadyError (cause: quonfig.QuonfigInitError) PROVIDER_READY once the client heals
"wait" blocks until config loads NOT_READY while waiting READY
"continue" no config by the timeout initialize() returns (READY), then the provider emits a non-fatal PROVIDER_ERROR, so the status is ERROR PROVIDER_READY once the client heals

The provider keeps the client after a failed init, and the client keeps retrying in the background. While it has no config, evaluations return your default with error code PROVIDER_NOT_READY. api.set_provider() runs initialize() on a background thread and never raises; under "fail", api.set_provider_and_wait() re-raises the ProviderNotReadyError. Use "continue" (it never raises) to start on code defaults.

Each later config update (SSE, poll, datadir reload) emits PROVIDER_CONFIGURATION_CHANGED. An on_config_update callback you pass still fires.

Development

poetry install
poetry run ruff check .
poetry run pytest -v

The package depends on the local sibling sdk-python/ repo via a Poetry path dependency; CI checks that out as a sibling directory and installs the same way.

Metadata

Release files for quonfig-openfeature 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quonfig-openfeature 3.1.0
File Size Uploaded Provenance Actions
quonfig_openfeature-3.1.0.tar.gz 11.8 kB With provenance Details for quonfig_openfeature-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quonfig-openfeature 3.1.0
File Interpreter ABI Platform Actions
quonfig_openfeature-3.1.0-py3-none-any.whl Python 3 none any Details for quonfig_openfeature-3.1.0-py3-none-any.whl

Total release size: 23.4 kB

Release files / quonfig_openfeature-3.1.0.tar.gz

Download URL quonfig_openfeature-3.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6d8a8f5a71752c8d2ece4b3a6aba35ed426f46e4049ab46eb3392e7957302937
BLAKE2b-256 checksum
How to use checksums
ba32d1d1597824f421805f9c10c621a86c5c41d57ec4a688bc6e3e5238ff7e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / quonfig_openfeature-3.1.0-py3-none-any.whl

Download URL quonfig_openfeature-3.1.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3767f4baa1f8455eadae664852ef795c9b8e4953888663aeb190551ab1e8fd9
BLAKE2b-256 checksum
How to use checksums
a488d205cfac20d6a83765e97d0abd7bd24ba55b8344cf7f9e6e85766731a973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for quonfig-openfeature 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for quonfig_openfeature-3.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page