Skip to main content

Unleash OpenFeature Python Provider

Python project scaffold managed with uv.

Prerequisites

  • Python 3.10+
  • uv

Install

uv add unleash-openfeature-python-provider

For local development, sync the project environment:

uv sync --dev

Test Harness

This repository includes the OpenFeature provider verifier as a git submodule. After cloning, initialize it before running the full test suite:

git submodule update --init --recursive

If the verifier submodule is intentionally updated, refresh it and commit the new submodule pointer:

git submodule update --remote --merge verifier
git status

Use

from openfeature import api
from openfeature.evaluation_context import EvaluationContext

from unleash_openfeature_python_provider import UnleashFlagProvider

# The provider builds and owns the Unleash client. Pass the same options you
provider = UnleashFlagProvider(
    url="https://app.unleash-hosted.com/demo/api",
    app_name="my-app",
    custom_headers={"Authorization": "<client-api-key>"},
)

api.set_provider_and_wait(provider)

client = api.get_client()
enabled = client.get_boolean_value(
    "my-feature",
    False,
    EvaluationContext(targeting_key="user-123"),
)

Example

uv run python examples/boolean_flag.py \
  --url https://app.unleash-hosted.com/demo/api \
  --api-key "$UNLEASH_API_KEY" \
  --flag-key my-feature \
  --targeting-key user-123

Build

uv build

Build artifacts are written to dist/.

Test

uv run pytest

Lint, Format, And Type Check

uv run ruff check
uv run ruff format
uv run basedpyright

Metadata

Release files for unleash-openfeature-python-provider 0.1.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 unleash-openfeature-python-provider 0.1.0
File Size Uploaded
unleash_openfeature_python_provider-0.1.0.tar.gz 91.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unleash-openfeature-python-provider 0.1.0
File Interpreter ABI Platform
unleash_openfeature_python_provider-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 96.3 kB

Release files / unleash_openfeature_python_provider-0.1.0.tar.gz

Download URL unleash_openfeature_python_provider-0.1.0.tar.gz
Size 91.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0d563e8541c9090d861f2cdabf76c6064365de7f31c4a2296e79a23199029fab
BLAKE2b-256 checksum
How to use checksums
af9a51389cb3bab594a9e288439fcc44eaf35dce19f4f972ca670d02f7493723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / unleash_openfeature_python_provider-0.1.0-py3-none-any.whl

Download URL unleash_openfeature_python_provider-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4653f39fbbd0a2a9e4001c452d6873d69b9baed3a03305bc6fd2d3f25ccb5678
BLAKE2b-256 checksum
How to use checksums
7c7465523261f0dcf7e93a423e1d77b5d88f889cfd43c74ca688a14c57af02f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

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