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.

A context with neither a targeting key nor an id attribute skips percentage rollouts: the targeting rules after the rollout are tried, and the flag resolves to the default targeting rule value when none applies. Give an anonymous context a stable targeting key, such as a session ID, to keep it in a rollout.

Evaluation details

Outcome reason error_code
A value was evaluated TARGETING_MATCH, with the variation's name as the variant when it has one, otherwise the value's id
A percentage rollout was skipped because the context has no targeting key or id DEFAULT, with the variant of the default targeting rule value
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.8.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 configdirector-openfeature-server-provider 1.8.1
File Size Uploaded Provenance Actions
configdirector_openfeature_server_provider-1.8.1.tar.gz 9.2 kB With provenance Details for configdirector_openfeature_server_provider-1.8.1.tar.gz

Built distribution (wheel)

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

Total release size: 20.8 kB

Release files / configdirector_openfeature_server_provider-1.8.1.tar.gz

Download URL configdirector_openfeature_server_provider-1.8.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ecb3b01fe934090cff5a1b332b1fc5f0974a8503e1f3323fdb8d33fa8adde62c
BLAKE2b-256 checksum
How to use checksums
dc193af4a23493f1e0703e0ea505b276e8ca5c14763338787df928eb8269046e
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 Nov 7, 2026.

Transparency log

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

Download URL configdirector_openfeature_server_provider-1.8.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1018528683d2ad8725f6215b8aaded475fc5dda533fb97224feb4fad010c411c
BLAKE2b-256 checksum
How to use checksums
5b3ca2576a0760415f1889b20efd230ff2e51677795fb7f9877a2d795642c31e
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 Nov 7, 2026.

Transparency log

Security for configdirector-openfeature-server-provider 1.8.1

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 configdirector_openfeature_server_provider-1.8.1.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 Nov 7, 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