{"library":"phidget22","title":"Phidget22 Python Wrapper","description":"Phidget22 is the official Python library for working with Phidgets in Python applications. It provides lightweight bindings to the native phidget22 library. The current version is 1.25.20260408, and the library is actively maintained with frequent updates, often multiple times per year, bundling native libraries for major operating systems.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install phidget22"],"cli":null},"imports":["from Phidget22.Phidget import *","from Phidget22.Devices.TemperatureSensor import TemperatureSensor"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import time\nfrom Phidget22.Phidget import *\nfrom Phidget22.Devices.TemperatureSensor import *\n\ndef onAttachHandler(self):\n    print(\"Attach Event: \" + self.getDeviceName())\n\ndef onDetachHandler(self):\n    print(\"Detach Event: \" + self.getDeviceName())\n\ndef onTemperatureChangeHandler(self, temperature):\n    print(\"Temperature: \" + str(temperature) + \" °C\")\n\ndef main():\n    try:\n        # Create your Phidget channels\n        temperatureSensor = TemperatureSensor()\n\n        # Set event handlers\n        temperatureSensor.setOnAttachHandler(onAttachHandler)\n        temperatureSensor.setOnDetachHandler(onDetachHandler)\n        temperatureSensor.setOnTemperatureChangeHandler(onTemperatureChangeHandler)\n\n        # Open your Phidget and wait for attachment\n        print(\"Waiting for Phidget TemperatureSensor to be attached...\")\n        temperatureSensor.openWaitForAttachment(5000)\n\n        print(\"Press Ctrl+C to Exit\\n\")\n        while(True):\n            time.sleep(1)\n\n    except PhidgetException as e:\n        print(\"Phidget Exception: \" + str(e.code) + \" - \" + e.details)\n    except KeyboardInterrupt:\n        pass\n    finally:\n        try:\n            temperatureSensor.close()\n        except PhidgetException as e:\n            print(\"Error closing Phidget: \" + str(e.code) + \" - \" + e.details)\n\nif __name__ == '__main__':\n    main()","lang":"python","description":"This quickstart initializes a `TemperatureSensor` object, registers event handlers for attachment, detachment, and temperature changes, and then waits for a sensor to be connected. It prints temperature readings to the console as they occur. The program includes basic error handling and a clean shutdown.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"1.25.20260408","pypi_latest":"1.25.20260408","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.7,"avg_import_s":0.01,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.01,"mem_mb":0.8,"disk_size":"19.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.01,"mem_mb":1.1,"disk_size":"22M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.01,"mem_mb":0.8,"disk_size":"21.4M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.02,"mem_mb":1.1,"disk_size":"24M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.01,"mem_mb":0.6,"disk_size":"13.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.02,"mem_mb":1.3,"disk_size":"16M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.01,"mem_mb":0.9,"disk_size":"13.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.02,"mem_mb":1.3,"disk_size":"15M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.01,"mem_mb":0.8,"disk_size":"18.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"phidget22","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.9,"import_time_s":0.02,"mem_mb":1.1,"disk_size":"21M"}]}}