{"id":23008,"library":"yoctopuce","title":"Yoctopuce Python API","description":"Official Python API for Yoctopuce sensors and actuators. Provides access to USB and networked Yoctopuce devices. Current version 2.1.12672, released regularly.","status":"active","version":"2.1.12672","language":"python","source_language":"en","source_url":"https://github.com/yoctopuce/yoctolib_python","tags":["yoctopuce","sensors","iot","api"],"install":[{"cmd":"pip install yoctopuce","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"wrong":"from yoctopuce.yapi import YAPI","symbol":"YAPI","correct":"from yoctopuce import YAPI"}],"quickstart":{"code":"from yoctopuce.yapi import YAPI\nfrom yoctopuce.ysensor import YSensor\n\n# Register a hub (adjust as needed)\nYAPI.PreregisterHub('usb')\n# Use default hub URL 'usb' for USB devices\nYAPI.RegisterHub('usb')\nsensor = YSensor.FirstSensor()\nif sensor:\n    print(f\"Sensor: {sensor.get_friendlyName()}, value: {sensor.get_currentValue()}\")\nYAPI.FreeAPI()","lang":"python","description":"Quickstart to list first Yoctopuce sensor. Preregister 'usb' for USB, or an IP address for networked hubs."},"warnings":[{"fix":"Use IPv4 address explicitly, e.g., YAPI.PreregisterHub('192.168.1.10')","message":"YAPI.PreregisterHub() may timeout with IPv6 addresses; use IPv4 or ensure DNS resolution works.","severity":"breaking","affected_versions":">=2.1.11416"},{"fix":"Always call YAPI.PreregisterHub() then YAPI.RegisterHub() for each hub.","message":"YAPI.RegisterHub() must be called after PreregisterHub() if using non-default hub.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use PreregisterHub before RegisterHub.","message":"YAPI.RegisterHub() without PreregisterHub() may be removed in future versions.","severity":"deprecated","affected_versions":">=2.0"}],"env_vars":null,"search_vec":"'2.1.12672':22 'access':13 'actuat':11 'api':3,6,28 'current':20 'devic':19 'iot':27 'network':17 'offici':4 'provid':12 'python':2,5 'regular':24 'releas':23 'sensor':9,26 'usb':15 'version':21 'yoctopuc':1,8,18,25","created_at":"2026-04-27T17:08:14.949729+00:00","updated_at":"2026-04-27T17:08:14.949729+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'YAPI' from 'yoctopuce' (/tmp/tmpftd_q1do/venv/lib/python3.12/site-packages/yoctopuce/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.1.13347","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.yoctopuce.com/EN/libraries.php","github":"https://github.com/yoctopuce/yoctolib_python","docs":"https://www.yoctopuce.com/EN/doc/reference/yoctolib-python-EN.html","changelog":"https://www.yoctopuce.com/EN/release_notes.php?sessionid=-1&file=YoctoLib.python.57762.zip","pypi":"https://pypi.org/project/yoctopuce/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"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}}