Skip to main content

A OpenFeature Python Environment Variable Provider

This provider loads flag values from environment variables. If a flag with some key is evaluated when no env var named after this key exists, it will throw a FlagNotFoundError. Otherwise it will attempt to parse the string value of the env var to the appropriate type (str,int,float, or object). Errors during this parsing are forwarded to the user.

Installation

pip install openfeature-provider-env-var

Usage

Create a new instance of the EnvVarProvider:

provider = EnvVarProvider()

Configure the OpenFeature API to use the EnvVarProvider and retrieve the client:

from openfeature import api
from openfeature.contrib.provider.envvar import EnvVarProvider

api.set_provider(EnvVarProvider())
client = api.get_client()
result = client.get_boolean_value("<your feature flag key>", True)

The EnvVarProvider will attempt to read values from the present environment variables. If no values is present for a flag key, it will throw a FlagNotFoundError. Otherwise, it will attempt to parse the value associated with the key to the requested type (e.g. float in the case of provider.resolve_float_details(key, 0.0, None)) and forward any error that is raised during parsing to the user. Note that any such errors will be caught by the OpenFeature API and translated into appropriate error codes.

Build setup

This provider uses uv as build tool.

Building

uv build

Executing tests

uv run pytest

pre commit hooks

Install the pre commit hooks that ensure proper formatting:

uvx pre-commit install

License

Apache 2.0 - See LICENSE for more information.

Metadata

Release files for openfeature-provider-env-var 0.1.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 openfeature-provider-env-var 0.1.1
File Size Uploaded
openfeature_provider_env_var-0.1.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openfeature-provider-env-var 0.1.1
File Interpreter ABI Platform
openfeature_provider_env_var-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / openfeature_provider_env_var-0.1.1.tar.gz

Download URL openfeature_provider_env_var-0.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6d254aa221dd1585a645ee836919c1e00cc2a2e8b287018f3275e2efc895d093
BLAKE2b-256 checksum
How to use checksums
72cc0d3c74178b1ea74f21af8c90ca9680e77dcc2b162b7d636990051431bd03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 19, 2026.

Transparency log

Release files / openfeature_provider_env_var-0.1.1-py3-none-any.whl

Download URL openfeature_provider_env_var-0.1.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96990a3784c2d2d9718942a3e85fb9574e5085f510686e7c9ff68f57c93c67a6
BLAKE2b-256 checksum
How to use checksums
20b77cdf90ee9f3085539e7ed8dfd0377a2db519638afc57f05baafbe0c86082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 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