{"id":44387,"library":"bec-lib","title":"BEC Library","description":"BEC (Browser Embedded Control) library provides data models and client/server communication classes for scientific beamline experiments. Current version 3.130.3, released weekly.","status":"active","version":"3.130.3","language":"python","source_language":"en","source_url":"https://github.com/bec-project/bec","tags":["bec","beamline","scientific","redis","control-system"],"install":[{"cmd":"pip install bec-lib","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for Redis backend communication (AlazarClient uses redis).","package":"redis","optional":false},{"reason":"Used for event model compatibility if using bluesky integration.","package":"bluesky","optional":true}],"imports":[{"wrong":"from bec_lib import BECMessage","symbol":"BECMessage","correct":"from bec_lib.endpoints import BECMessage"}],"quickstart":{"code":"import os\nfrom bec_lib.client import AlazarClient\n\nclient = AlazarClient(\n    redis_host=os.environ.get('REDIS_HOST', 'localhost'),\n    redis_port=int(os.environ.get('REDIS_PORT', '6379')),\n)\nprint(client.is_alive())","lang":"python","description":"Connect to a BEC Redis server and check aliveness. Requires a running Redis instance."},"warnings":[{"fix":"Replace 'from bec_lib.alazar import AlazarClient' with 'from bec_lib.client import AlazarClient'.","message":"v3.0 removed the old 'bec_lib.alazar' module; use 'bec_lib.client.AlazarClient'.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use AlazarClient which internally manages the connector.","message":"RedisConnector is deprecated in favor of direct client usage (AlazarClient).","severity":"deprecated","affected_versions":"<=3.130.3"},{"fix":"Always use 'import bec_lib' in code, not 'bec-lib'.","message":"The package is installed as 'bec-lib' with a hyphen, but Python imports use 'bec_lib' with an underscore.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure Redis is running or provide different host/port via environment variables.","message":"By default, the client expects a Redis server on localhost:6379. If not running, connection will hang.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'3.130.3':21 'beamlin':17,25 'bec':1,3,24 'browser':4 'class':14 'client/server':12 'communic':13 'control':6,29 'control-system':28 'current':19 'data':9 'embed':5 'experi':18 'librari':2,7 'model':10 'provid':8 'redi':27 'releas':22 'scientif':16,26 'system':30 'version':20 'week':23","created_at":"2026-06-07T12:49:53.245285+00:00","updated_at":"2026-06-07T12:49:53.245285+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'BECMessage' from 'bec_lib.endpoints' (/tmp/tmppnrx2h0e/venv/lib/python3.12/site-packages/bec_lib/endpoints.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/bec-project/bec","github":"https://github.com/bec-project/bec","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}