Skip to main content

ConfigDirector OpenFeature Python Server Provider

CI PyPI

OpenFeature Python server provider for ConfigDirector, remote config and feature flags with typed values, JSON Schema validation, and safe renames of live flags. It wraps the ConfigDirector Python server SDK and requires Python 3.10 or newer.

Install

pip install configdirector-openfeature-server-provider

The OpenFeature Python SDK (openfeature-sdk) and the ConfigDirector Python server SDK come with it as dependencies.

Retrieve a value

from configdirector_openfeature import ConfigDirectorProvider
from openfeature import api

# The server SDK key is a secret. Do not commit it to your source code.
api.set_provider_and_wait(ConfigDirectorProvider("YOUR-SERVER-SDK-KEY"))
client = api.get_client()

new_checkout = client.get_boolean_value("new-checkout", False)

set_provider_and_wait waits up to the connection timeout, 3 seconds by default, for config to arrive. If none arrives in time, or ConfigDirector rejects the server SDK key, it raises openfeature.exception.ProviderNotReadyError and OpenFeature reports the ERROR status. Evaluations then return their in-code default values with PROVIDER_NOT_READY. After a timeout the provider keeps connecting, and OpenFeature reports READY once config arrives.

To start without waiting for ConfigDirector, call api.set_provider instead, which initializes the provider in the background, or catch the error:

import logging

from openfeature.exception import ProviderNotReadyError

try:
    api.set_provider_and_wait(ConfigDirectorProvider("YOUR-SERVER-SDK-KEY"))
except ProviderNotReadyError as error:
    logging.warning("Starting on in-code default values until ConfigDirector sends config: %s", error)

The provider accepts the same metadata, connection, logger, log_level, and telemetry options as the server SDK's create_client.

Evaluation context

The OpenFeature evaluation context maps onto the ConfigDirector context used by targeting rules:

OpenFeature ConfigDirector
targeting_key, or failing that an id attribute id
kind attribute kind
name attribute name
traits attribute, a mapping traits
anonymous attribute, a boolean anonymous
from openfeature.evaluation_context import EvaluationContext

context = EvaluationContext("user-123", {"name": "Ada", "traits": {"plan": "pro"}})
new_checkout = client.get_boolean_value("new-checkout", False, context)

device = EvaluationContext("kiosk-7", {"kind": "device"})
new_checkout = client.get_boolean_value("new-checkout", False, device)

Without a kind attribute the context is a user, and a kind inside traits is an ordinary trait. A kind has 1 to 64 characters, using only lowercase letters, digits, - and _. When the kind is invalid, including any kind that is not a string, the whole context is ignored: the evaluation still resolves successfully, to the value for no context, and the SDK logs an error.

Evaluation details

Outcome reason error_code
A value was evaluated TARGETING_MATCH, with the value's id as the variant
The config has no value DEFAULT
No config has that key ERROR FLAG_NOT_FOUND
The value does not match the requested type ERROR TYPE_MISMATCH
No config state has been received yet ERROR PROVIDER_NOT_READY

PROVIDER_READY fires once, when config first arrives. The provider emits PROVIDER_CONFIGURATION_CHANGED whenever configs are updated, with the keys the update carried followed by the keys a full update removed.

Test your code

Tests of code that reads flags through OpenFeature swap the provider for the in-memory one the OpenFeature Python SDK ships, InMemoryProvider, so the test controls the values and nothing from ConfigDirector is involved:

from openfeature import api
from openfeature.provider.in_memory_provider import InMemoryFlag, InMemoryProvider

api.set_provider_and_wait(InMemoryProvider({"new-checkout": InMemoryFlag("on", {"on": True, "off": False})}))
client = api.get_client()

assert client.get_boolean_value("new-checkout", False) is True

The provider copies its flags and has no method to change them, so a mid-test change sets a new provider. Shut OpenFeature down after each test with api.shutdown(). Full details are in the testing section of the official documentation.

Documentation

Refer to the official documentation for the OpenFeature Python provider.

There is also a quickstart guide for ConfigDirector and any of our SDKs.

Sample apps

samples/configdirector-openfeature-server-provider/ holds small, runnable applications built on this provider. Start with flask:

cd samples/configdirector-openfeature-server-provider/flask
uv run flask --app app run --port 3600

Getting Help

Metadata

Release files for configdirector-openfeature-server-provider 1.7.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 configdirector-openfeature-server-provider 1.7.0
File Size Uploaded Provenance Actions
configdirector_openfeature_server_provider-1.7.0.tar.gz 8.3 kB With provenance Details for configdirector_openfeature_server_provider-1.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for configdirector-openfeature-server-provider 1.7.0
File Interpreter ABI Platform Actions
configdirector_openfeature_server_provider-1.7.0-py3-none-any.whl Python 3 none any Details for configdirector_openfeature_server_provider-1.7.0-py3-none-any.whl

Total release size: 19.0 kB

Release files / configdirector_openfeature_server_provider-1.7.0.tar.gz

Download URL configdirector_openfeature_server_provider-1.7.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b92a958d40761dd278074e2f3f9ad3ff60094960d34d74bb95e0b4dc07fc3f77
BLAKE2b-256 checksum
How to use checksums
ddb155e5d1c22fd0ea707ce36446fe9d69f983e20188c5f32f432d4b6773ceb6
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 28, 2026.

Transparency log

Release files / configdirector_openfeature_server_provider-1.7.0-py3-none-any.whl

Download URL configdirector_openfeature_server_provider-1.7.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a08abcef41dce29005507b9de041ad967a908cb7cb3103f6cd47ed5f47a29221
BLAKE2b-256 checksum
How to use checksums
5411d21e2f8f4935be882a1ba5ab58056bae43d8ac3bd993e8a87efb1dbd0f2c
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 28, 2026.

Transparency log

Security for configdirector-openfeature-server-provider 1.7.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for configdirector_openfeature_server_provider-1.7.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 28, 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