Skip to main content

FeatBit OpenFeature Provider for Python Server SDK

Thin OpenFeature provider backed by an existing FeatBit Python Server SDK client. The provider converts OpenFeature evaluation contexts and resolution details; feature flag synchronization, local evaluation, and insight events remain owned by fb-python-sdk.

Installation

pip install featbit-openfeature-server

The provider supports Python 3.10–3.14 and requires fb-python-sdk>=1.2.0, which exposes variation IDs and data-update status listeners.

Usage

from fbclient.client import FBClient
from fbclient.config import Config
from openfeature import api
from openfeature.evaluation_context import EvaluationContext

from featbit_openfeature import FeatBitProvider

fb_client = FBClient(
    Config(
        "server-side-environment-secret",
        event_url="https://app-eval.featbit.co",
        streaming_url="wss://app-eval.featbit.co",
    ),
    start_wait=0,
)

api.set_provider_and_wait(FeatBitProvider(fb_client))
client = api.get_client()

details = client.get_boolean_details(
    "new-checkout",
    False,
    EvaluationContext(
        targeting_key="user-123",
        attributes={"name": "Alice", "plan": "beta"},
    ),
)

print(details.value, details.reason, details.variant)

api.shutdown()

The provider owns the injected FBClient. Calling api.shutdown() removes provider listeners and stops the FeatBit client so queued events are flushed and background resources are released.

Supported mappings

  • Boolean, string, integer, float, and object resolution.
  • OpenFeature targeting key and scalar attributes to a FeatBit user dictionary.
  • FeatBit reasons and failures to OpenFeature Reason and ErrorCode.
  • FeatBit variation ID to OpenFeature variant.
  • FeatBit flag changes to PROVIDER_CONFIGURATION_CHANGED.
  • FeatBit runtime data-source status to OpenFeature provider status.
  • OpenFeature tracking value to FBClient.track_metric().

Structured evaluation-context attributes and tracking custom attributes are not supported by the current FeatBit user and metric schemas. They are ignored rather than represented inaccurately.

Provider status

Applications can read the status through the standard OpenFeature client:

from openfeature.provider import ProviderStatus

status = client.get_provider_status()
assert status in {
    ProviderStatus.NOT_READY,
    ProviderStatus.READY,
    ProviderStatus.STALE,
    ProviderStatus.ERROR,
    ProviderStatus.FATAL,
}

FeatBit states are mapped as follows:

FeatBit state OpenFeature status
initializing NOT_READY during provider initialization
OK READY
interrupted STALE
off observed while provider is active FATAL

After api.shutdown(), OpenFeature removes this provider and installs its default no-op provider. Status after that point belongs to the OpenFeature SDK rather than to FeatBit.

The included py.typed marker declares this package as PEP 561 typed, allowing type checkers to use the annotations shipped with the provider after install.

Development tests

Unit tests use mocks, and the integration test uses FeatBit offline data. Neither requires a FeatBit account.

python -m pytest -q
python -m flake8 featbit_openfeature tests
python -m build

Release

Publishing is handled by .github/workflows/release.yml when a GitHub Release is published. The build and publish jobs are separated so package build code never receives an OpenID Connect token. The publish job uses PyPI Trusted Publishing and does not store a long-lived PyPI password in GitHub.

Before the first release, configure the PyPI trusted publisher with owner featbit, repository openfeature-provider-python-server, workflow release.yml, and GitHub environment pypi.

Metadata

Release files for featbit-openfeature-server 1.2.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 featbit-openfeature-server 1.2.0
File Size Uploaded Provenance Actions
featbit_openfeature_server-1.2.0.tar.gz 17.5 kB With provenance Details for featbit_openfeature_server-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for featbit-openfeature-server 1.2.0
File Interpreter ABI Platform Actions
featbit_openfeature_server-1.2.0-py3-none-any.whl Python 3 none any Details for featbit_openfeature_server-1.2.0-py3-none-any.whl

Total release size: 30.3 kB

Release files / featbit_openfeature_server-1.2.0.tar.gz

Download URL featbit_openfeature_server-1.2.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f67d39986b91d2055f534caa90049f44f7ffbfc208f633e4779ecc3fc827387
BLAKE2b-256 checksum
How to use checksums
ed32caf4ec3c3ab9007e6accca96d05ce126c1d57e39e32d9e231d425ec11729
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 3, 2026.

Transparency log

Release files / featbit_openfeature_server-1.2.0-py3-none-any.whl

Download URL featbit_openfeature_server-1.2.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58e4ee605171b98da494533c21cf51b3b61ce4fbef2fb447fb40b738f199183f
BLAKE2b-256 checksum
How to use checksums
bf5c3ceb2d6740612f708aa639da96ae7daf272bb901e907f52f10f337237886
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 3, 2026.

Transparency log

Security for featbit-openfeature-server 1.2.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 featbit_openfeature_server-1.2.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 Nov 3, 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