Skip to main content

OpenFeature provider for Flagcel with local CEL evaluation

Project description

Flagcel OpenFeature Provider for Python

OpenFeature provider for Flagcel with local CEL evaluation. The provider polls Flagcel for evaluation definitions, compiles rules with cel-expr-python, and evaluates flags in-process.

python -m pip install flagcel-openfeature
from openfeature import api
from openfeature.evaluation_context import EvaluationContext
from flagcel_openfeature import FlagcelProvider

provider = FlagcelProvider(
    endpoint="http://localhost:8080/api/v1",
    api_key="fc_example_secret",
)
api.set_provider(provider)

client = api.get_client("checkout-service")
enabled = client.get_boolean_value(
    "new-checkout",
    False,
    EvaluationContext(
        targeting_key="u_123",
        attributes={"user": {"id": "u_123", "country": "US"}},
    ),
)

Behavior

  • Requires Python 3.11+.
  • Fetches GET /eval/definitions relative to the configured endpoint.
  • Sends Authorization: Bearer <api_key> when an API key is configured; the API key selects the evaluation environment.
  • Polls definitions every 30 seconds by default.
  • Uses ETag and If-None-Match to avoid reloading unchanged definitions.
  • Evaluates flags locally with CEL expressions from the latest definitions.
  • Returns OpenFeature defaults with provider-not-ready details if no definitions have loaded.
  • Keeps using last-known definitions after later refresh failures.
  • Maps Flagcel reason, variant, and value type into OpenFeature resolution details.

Configure the polling interval in seconds:

provider = FlagcelProvider(
    endpoint="http://localhost:8080/api/v1",
    api_key="fc_example_secret",
    poll_interval=10.0,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flagcel_openfeature-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flagcel_openfeature-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file flagcel_openfeature-0.1.0.tar.gz.

File metadata

  • Download URL: flagcel_openfeature-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flagcel_openfeature-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b7ac6f5840011dd4f6e9635c5478bef63e294422ae15d7a707d854b0723952b
MD5 20ecb84d9cb01d8d761b740197315b67
BLAKE2b-256 568796a9d6f72fce4b69f00f10f64795ac3c9a01b298b6351413391dbce6d791

See more details on using hashes here.

Provenance

The following attestation bundles were made for flagcel_openfeature-0.1.0.tar.gz:

Publisher: release-py.yml on picunada/flagcel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flagcel_openfeature-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flagcel_openfeature-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5511f9ca56ec5d2ca7d732ce3d5e00ad3843a4ce3c3011015581d93c5020d56d
MD5 1a725c620aa739d50aaef15d1c942ced
BLAKE2b-256 1969ee3a306d826b340ab3deeb80216d3e76d3bdd172a9c499ea02e51e0ef506

See more details on using hashes here.

Provenance

The following attestation bundles were made for flagcel_openfeature-0.1.0-py3-none-any.whl:

Publisher: release-py.yml on picunada/flagcel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page