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 needs openfeature-sdk 0.10 or newer. On an older version use api.set_provider, which waits for the provider to initialize there.

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

If the first config state does not arrive within the configured timeout, initialization still completes and evaluations return their defaults. The provider keeps connecting, and emits PROVIDER_READY once config state arrives. It 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.5.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.5.0
File Size Uploaded
configdirector_openfeature_server_provider-1.5.0.tar.gz 7.4 kB Details

Built distribution (wheel)

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

Total release size: 17.0 kB

Release files / configdirector_openfeature_server_provider-1.5.0.tar.gz

Download URL configdirector_openfeature_server_provider-1.5.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fd28856de9a5a7b17be623fffe66ecad56ca858f3b6a89c4b42daa37199759f
BLAKE2b-256 checksum
How to use checksums
b443f560286445220bc9cf4a09b4e2486ae67fa7669d180cfd720021b3f06f53
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 Oct 15, 2026.

Transparency log

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

Download URL configdirector_openfeature_server_provider-1.5.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135f87c9155cac8cee93f78faaef083c64a28207ade2d28d12198b052e570e3c
BLAKE2b-256 checksum
How to use checksums
bf1d06dd5e22bfb5d971181f3e7f17e57b9852547cfc5616816ef2daf64a8cb0
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 Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

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