{"id":28054,"library":"prefab-cloud-python","title":"Prefab Cloud Python","description":"Official Python client for Prefab, a feature flags, dynamic log levels, and configuration-as-a-service platform. Supports context-aware evaluations, SSE streaming, and cloud-based configuration management. Current version: 0.12.1, requires Python >=3.9, <4. Release cadence: monthly.","status":"active","version":"0.12.1","language":"python","source_language":"en","source_url":"https://github.com/prefab-cloud/prefab-cloud-python","tags":["feature-flags","configuration","feature-management","dynamic-logging"],"install":[{"cmd":"pip install prefab-cloud-python","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Protocol buffers for configuration data","package":"protobuf","optional":false},{"reason":"gRPC for streaming updates","package":"grpcio","optional":false}],"imports":[{"note":"Top-level package name is 'prefab', not 'prefab_cloud_python'.","wrong":"from prefab_cloud_python import Client","symbol":"Client","correct":"from prefab import Client"},{"note":"Class name is Prefab, not a module.","wrong":"import Prefab","symbol":"Prefab","correct":"from prefab import Prefab"},{"note":"","wrong":"","symbol":"Context","correct":"from prefab import Context"}],"quickstart":{"code":"import os\nfrom prefab import Prefab, Context\n\nclient = Prefab(api_key=os.environ.get('PREFAB_API_KEY', ''))\ncontext = Context(user_key=\"user-123\", attributes={\"plan\": \"premium\"})\nflag = client.check(\"my-feature-flag\", context)\nprint(\"Flag enabled:\", flag)\n","lang":"python","description":"Initialize Prefab with an API key, create a context, and evaluate a flag."},"warnings":[{"fix":"Replace 'import prefab_cloud_python' with 'from prefab import Prefab' and update usage accordingly.","message":"The import path changed from 'import prefab_cloud_python' to 'from prefab import Client/Prefab' in version 0.11.0.","severity":"breaking","affected_versions":"<0.11.0"},{"fix":"Always create a Context with at least a user_key and pass it to client.check().","message":"Context must be passed to most flag evaluations; omitting it may lead to incorrect results.","severity":"gotcha","affected_versions":">=0.12.0"},{"fix":"Use 'Prefab' class with api_key parameter directly.","message":"The 'PrefabConfig' object is deprecated in favor of 'Prefab' and 'Client'.","severity":"deprecated","affected_versions":"<0.11.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from prefab import Client' instead of 'from prefab_cloud_python import Client'.","cause":"The package is installed as 'prefab-cloud-python' but the import module is 'prefab'.","error":"ImportError: cannot import name 'Client' from 'prefab_cloud_python'"},{"fix":"Pass a Context object: client.check('flag-key', Context(user_key='...'))","cause":"The 'context' parameter became mandatory in v0.12.0.","error":"TypeError: check() missing 1 required positional argument: 'context'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}