switchbox-openfeature
OpenFeature provider for Switchbox feature flags.
What is this?
A thin provider that plugs Switchbox into the vendor-neutral OpenFeature API. Your app codes against OpenFeature; Switchbox is one constructor line. Swap vendors by swapping the provider, not your call sites. That is the point: no lock-in.
The provider contains zero evaluation logic. It wraps switchbox-flags, which fetches static JSON from a CDN and evaluates rules locally in your process. Nothing about the architecture changes: same 30 second polling, same local evaluation, same deterministic rollouts. Every resolve is a direct in-process call, so evaluation costs zero network.
Install
pip install switchbox-openfeature
This pulls in openfeature-sdk and switchbox-flags.
Quick Start
from openfeature import api
from openfeature.evaluation_context import EvaluationContext
from switchbox_openfeature import SwitchboxProvider
api.set_provider(SwitchboxProvider(sdk_key="your-sdk-key-from-dashboard"))
client = api.get_client()
context = EvaluationContext(targeting_key="user-42", attributes={"plan": "pro"})
if client.get_boolean_value("new_checkout", False, context):
show_new_checkout()
SwitchboxProvider(...) accepts every Switchbox constructor option (poll_interval, cdn_base_url, on_error, ...). To share a client you already manage, pass it instead; the provider will not close it:
provider = SwitchboxProvider(client=my_switchbox)
Context mapping
OpenFeature's evaluation context maps onto the Switchbox user context:
| OpenFeature | Switchbox |
|---|---|
targeting_key |
user_id (deterministic rollout bucketing) |
| every other attribute | targeting attribute, passed through as-is |
Error behavior
- Missing flag: OpenFeature returns your code default with
FLAG_NOT_FOUND - Evaluated value has the wrong type: code default with
TYPE_MISMATCH - CDN unreachable at startup: the provider reports not-ready and OpenFeature serves code defaults (the same fail-safe posture as the SDK itself)
License
MIT
Metadata
Release files for switchbox-openfeature 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| switchbox_openfeature-0.1.0.tar.gz | 5.9 kB | With provenance | Details for switchbox_openfeature-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| switchbox_openfeature-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for switchbox_openfeature-0.1.0-py3-none-any.whl |
Total release size: 10.8 kB
Release files / switchbox_openfeature-0.1.0.tar.gz
| Download URL | switchbox_openfeature-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
303181ec470063ef1e4ba11d15e1879ee8133434d0f133e8c8a80d3fbd71da87
|
|
BLAKE2b-256 checksum How to use checksums |
41bfd17ed0a7b2d2e91bfed80c5ac53cb34bd1d67d5377ac029bcc3f727c0870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 12, 2026.
Transparency logRelease files / switchbox_openfeature-0.1.0-py3-none-any.whl
| Download URL | switchbox_openfeature-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06a225fd9ec3871c07c891d0f6d4024da0707f13ca89011d1ada2a7fafbb9a1c
|
|
BLAKE2b-256 checksum How to use checksums |
15fef6a373baef5d9abb29dd9ae27d7583b388ab0b181c05ccc60d4a8903c8d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 12, 2026.
Transparency logSecurity for switchbox-openfeature 0.1.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.
Attestation for switchbox_openfeature-0.1.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 Jul 12, 2026.
Transparency logA 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.