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.1.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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flagcel_openfeature-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1a5031ed4db571c05a2f19f716c9c9ed5a23eb93ad2b1e5c1bf1d3633b8f0838
MD5 f1a27dba54c8bbdb8423ca7d3ae15a0d
BLAKE2b-256 1d85a958c32646e955640df55aefc1b3a00103a7b4572845ad787f51fe00c5e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for flagcel_openfeature-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flagcel_openfeature-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9de5bef1abe7035e9eb487e11a0fcfe058db3f0219b79f44e459bbb0a4b9669f
MD5 cb2e408621d99e43190ede5c94c51955
BLAKE2b-256 dabce730a8b4190fa2c42e33714c2bfe808371ca80deb581e2e1d5c6cdbffcf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for flagcel_openfeature-0.1.1-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