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.1, 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.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 featbit-openfeature-server 1.2.1
File Size Uploaded Provenance Actions
featbit_openfeature_server-1.2.1.tar.gz 17.5 kB With provenance Details for featbit_openfeature_server-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 30.2 kB

Release files / featbit_openfeature_server-1.2.1.tar.gz

Download URL featbit_openfeature_server-1.2.1.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d0d98ba46c4e32ad4d7747b55c34affc3505cc2c002581a281dba4f0adbc9fd
BLAKE2b-256 checksum
How to use checksums
c5d0f1ed703a1ae0c2b4553f1527bc203575b60c779c26c20366d6555c99ac96
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 4, 2026.

Transparency log

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

Download URL featbit_openfeature_server-1.2.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d8b731ff3eabfd26375a78c77e97cf667324c85f1a3eaa8bbb934f7d2426d7b
BLAKE2b-256 checksum
How to use checksums
6791c796ce18da0f2c54b35f006000c56fe2980bfb2f54acd55393b51d554a45
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 4, 2026.

Transparency log

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