{"id":21516,"library":"launchdarkly-openfeature-server","title":"LaunchDarkly OpenFeature Provider for Python Server SDK","description":"An OpenFeature provider that bridges the LaunchDarkly Python server SDK with the OpenFeature API, enabling feature flag evaluation through the standard OpenFeature interface. Current version 0.5.1, requires Python <4.0,>=3.9. Pre-1.0 release with active development.","status":"active","version":"0.5.1","language":"python","source_language":"en","source_url":"https://github.com/launchdarkly/openfeature-python-server","tags":["feature-flags","openfeature","launchdarkly","provider","server-sdk"],"install":[{"cmd":"pip install launchdarkly-openfeature-server","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Required for LD client configuration.","package":"launchdarkly-server-sdk","optional":false},{"reason":"Required for OpenFeature API.","package":"openfeature-sdk","optional":false}],"imports":[{"note":"Provider is in the 'server' submodule, not top-level.","wrong":"from launchdarkly_openfeature import LaunchDarklyProvider","symbol":"LaunchDarklyProvider","correct":"from launchdarkly_openfeature.server import LaunchDarklyProvider"}],"quickstart":{"code":"import os\nfrom ldclient import Config, LDClient\nfrom openfeature import api\nfrom openfeature.evaluation_context import EvaluationContext\nfrom launchdarkly_openfeature.server import LaunchDarklyProvider\n\n# Initialize LD client\nld_config = Config(os.environ.get('LAUNCHDARKLY_SDK_KEY', ''))\nld_client = LDClient(config=ld_config)\n\n# Set provider in OpenFeature\napi.set_provider(LaunchDarklyProvider(ld_client))\n\n# Get OpenFeature client\nclient = api.get_client()\n\n# Evaluate a flag\ntargeting_key = 'user-key'\nctx = EvaluationContext(targeting_key=targeting_key, attributes={'email': 'user@example.com'})\nresult = client.get_boolean_value('my-flag', default_value=False, evaluation_context=ctx)\nprint(f'Flag value: {result}')","lang":"python","description":"Simple example showing initialization and flag evaluation."},"warnings":[{"fix":"Instantiate LDClient with config and pass it to LaunchDarklyProvider.","message":"The provider requires an initialized LDClient instance. Do not use ldclient.set_sdk_key() global initialization; the provider expects an explicit client.","severity":"breaking","affected_versions":"all"},{"fix":"Pin exact version in requirements: launchdarkly-openfeature-server==0.5.1","message":"The library is pre-1.0 (0.x.y). APIs may change without major version bump. Pin to exact version in production.","severity":"gotcha","affected_versions":"all <1.0"},{"fix":"Create explicit LDClient and pass to provider.","message":"Do not use ldclient.get() global client. The provider expects an explicit LDClient instance.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install via: pip install launchdarkly-openfeature-server","cause":"Installed wrong package or missing dependency.","error":"ModuleNotFoundError: No module named 'launchdarkly_openfeature'"},{"fix":"Use: from launchdarkly_openfeature.server import LaunchDarklyProvider","cause":"Importing from wrong submodule.","error":"ImportError: cannot import name 'LaunchDarklyProvider' from 'launchdarkly_openfeature'"},{"fix":"Ensure api.set_provider() is called before api.get_client().","cause":"OpenFeature client not properly initialized or provider not set.","error":"AttributeError: 'NoneType' object has no attribute 'get_boolean_value'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}