{"id":27841,"library":"gofeatureflag-python-provider","title":"GO Feature Flag Python Provider","description":"An OpenFeature provider for GO Feature Flag, enabling feature flag evaluation in Python applications. Version 1.0.0 supports OpenFeature 1.x and requires Python >=3.9. Released with monthly cadence.","status":"active","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/thomaspoignant/go-feature-flag/tree/main/openfeature/providers/python-provider","tags":["openfeature","feature-flags","go-feature-flag","provider"],"install":[{"cmd":"pip install gofeatureflag-python-provider","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Required for the OpenFeature API","package":"openfeature-sdk","optional":false}],"imports":[{"note":"Provider class is in the provider submodule, not package root.","wrong":"from gofeatureflag_python_provider import GoFeatureFlagProvider","symbol":"GoFeatureFlagProvider","correct":"from gofeatureflag_python_provider.provider import GoFeatureFlagProvider"}],"quickstart":{"code":"import os\nfrom openfeature import api\nfrom openfeature.evaluation_context import EvaluationContext\nfrom gofeatureflag_python_provider.provider import GoFeatureFlagProvider\n\n# Set endpoint via environment variable\nendpoint = os.environ.get('GOFEATUREFLAG_ENDPOINT', 'http://localhost:1031')\nprovider = GoFeatureFlagProvider(endpoint=endpoint)\napi.set_provider(provider)\nclient = api.get_client()\n\n# Evaluate a boolean flag\ntargeting_key = \"user-key\"\ncontext = EvaluationContext(targeting_key=targeting_key, attributes={\"email\": \"test@example.com\"})\nflag_value = client.get_boolean_value(\"my-feature-flag\", default=False, evaluation_context=context)\nprint(f\"Flag value: {flag_value}\")","lang":"python","description":"Initialize the GO Feature Flag provider, set it as the OpenFeature provider, and evaluate a boolean flag."},"warnings":[{"fix":"Create a new provider instance per thread or use a threading lock.","message":"Provider is not thread-safe: The GoFeatureFlagProvider currently uses a shared HTTP session that is not thread-safe. Avoid sharing a single provider instance across multiple threads without external synchronization.","severity":"breaking","affected_versions":"<=1.0.0"},{"fix":"Ensure openfeature-sdk is version 1.x.","message":"OpenFeature SDK v0.x incompatibility: This provider is designed for OpenFeature SDK v1.x. Using it with v0.x will cause import errors.","severity":"deprecated","affected_versions":"<=1.0.0"},{"fix":"Set the GOFEATUREFLAG_ENDPOINT environment variable or pass the endpoint argument.","message":"Provider requires explicit endpoint: The default endpoint is localhost:1031. If your GO Feature Flag relay proxy is elsewhere, you must set the endpoint explicitly via environment variable or constructor argument.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from gofeatureflag_python_provider.provider import GoFeatureFlagProvider","cause":"Wrong import path: trying to import from package root instead of the provider submodule.","error":"ImportError: cannot import name 'GoFeatureFlagProvider' from 'gofeatureflag_python_provider'"},{"fix":"Upgrade openfeature-sdk to >=1.0 and use api.set_provider(provider) instead of provider.initialize().","cause":"Using an older OpenFeature SDK (<1.0) where initialize is called differently.","error":"AttributeError: 'GoFeatureFlagProvider' object has no attribute 'initialize'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}