--- id: gpiozero version: "2.0.1.post3" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # gpiozero — A simple interface to GPIO devices with Raspberry Pi License: permissive · Maintenance: active · Downloads: 435.4K/mo ## What it is and what it does gpiozero is a Python library that simplifies GPIO programming on Raspberry Pi and compatible single-board computers. It provides object-oriented interfaces to common components—LEDs, buttons, sensors, motors—so you can control hardware with just a few lines of code rather than managing raw GPIO pins. The library supports both imperative (direct method calls) and declarative (event-driven) programming styles, and includes a mock pin interface for testing without hardware. The package abstracts away the complexity of underlying pin libraries, letting you switch between different GPIO backends (RPi.GPIO, pigpio, etc.) without changing your application code. It's designed for physical computing education and hobbyist projects, but scales to more complex setups through its source/values system for composing sensor inputs and device behaviors. Use it for: - Control an LED or relay directly: turn it on/off or blink it with minimal code. - Build event-driven circuits: trigger actions when a button is pressed or a sensor detects motion. - Combine multiple sensors to control an output: e.g., turn on a garden light only when motion is detected AND it's dark. - Prototype robotics or automation projects without writing low-level GPIO boilerplate. - Test GPIO logic on a PC using mock pins before deploying to a Raspberry Pi. - Teach physical computing concepts with readable, beginner-friendly Python syntax. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. gpiozero provides a high-level Python interface for controlling GPIO devices on Raspberry Pi and compatible boards, abstracting away low-level pin manipulation with simple, declarative component classes. Yes. gpiozero is the standard choice for Raspberry Pi GPIO programming in Python—actively maintained, permissively licensed, low friction to install, and well-documented. It's suitable for beginners learning physical computing and for production hobby/educational projects. Install it if you're working with Raspberry Pi GPIO devices and want to avoid raw pin manipulation. ## Install pip install gpiozero uv add gpiozero poetry add gpiozero ## Installing gpiozero Before you install: Low install friction with only three lightweight runtime dependencies (colorzero, importlib-metadata, importlib-resources). Actively maintained with a recent release 18 days ago and consistent commit activity; supports current Python versions (3.9–3.12 and PyPy). License in practice: BSD-3-Clause (permissive) allows free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects. Quickstart: pip install gpiozero from gpiozero import LED from time import sleep led = LED(17) led.on() sleep(1) led.off() Requires a Raspberry Pi or compatible board with GPIO pins, or mock pins for testing on other systems. Verify before relying: - Whether the package works reliably on all advertised Python implementations (PyPy support level). - Performance characteristics when controlling many devices simultaneously. - Compatibility with non-Raspberry Pi GPIO boards beyond what the documentation states. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 435.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags raspberry pi gpio control, python led button sensor, gpio device interface, raspberry pi physical computing, simple gpio library, pi hardware abstraction, component-based gpio, raspberry-pi, hardware-control, iot [View on SkillFed](https://skillfed.io/packages/gpiozero) · [View on PyPI](https://pypi.org/project/gpiozero/)