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 -- return the raw float seconds via get_float_value() (or use get_duration() natively).
  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.

Configuration changed events

The provider extends OpenFeature's AbstractProvider, so you can register event handlers via the standard api if you want to know when configs update. The native quonfig SDK pushes live updates over SSE; surfacing those as PROVIDER_CONFIGURATION_CHANGED events is on the roadmap.

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 1.0.1

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 1.0.1
File Size Uploaded
quonfig_openfeature-1.0.1.tar.gz 7.0 kB Details

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / quonfig_openfeature-1.0.1.tar.gz

Download URL quonfig_openfeature-1.0.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
387bf7b514c143ca5313aa17c3e8a0cb161229c56467f852108d6ccaaf2be7af
BLAKE2b-256 checksum
How to use checksums
cbc538e59ee5dbd1715a7f44efc64fb4bf8b1073308084aa2cda5b8563b99841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

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

Download URL quonfig_openfeature-1.0.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e76968d01ffd1c092b46b99b399456214d2057eaeedd9e7657538c693e3a28
BLAKE2b-256 checksum
How to use checksums
fb334b3f1bc2207a562a72b66fe65cb406fb0512c455d4f985fd5fabb0ff2f8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

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