--- id: gpiod version: "2.5.0" license: LGPL-2.1-or-later license_treatment: copyleft maintenance: active --- # gpiod — Python bindings for libgpiod License: copyleft · Maintenance: active · Downloads: 643.4K/mo ## What it is and what it does gpiod is the official Python interface to libgpiod, the modern Linux kernel GPIO character device API. It replaces the deprecated sysfs interface with a more capable, resource-safe approach that guarantees cleanup on device close. The package vendors libgpiod for convenience, so you don't need a matching system library unless you explicitly opt in via LINK_SYSTEM_LIBGPIOD=1. You use it to request GPIO lines from character devices like /dev/gpiochip0, configure them as inputs or outputs, read or write values, and poll for events. It supports advanced features like open-source and open-drain modes, bulk value operations, and event monitoring. The bindings are not thread-safe and require external synchronization if shared across threads, though both GIL-enabled and free-threaded CPython are supported. Use it for: - Control LEDs, buttons, and sensors on Raspberry Pi or other Linux single-board computers. - Implement GPIO-based hardware monitoring or automation in embedded systems. - Poll GPIO lines for state changes and react to hardware events in real time. - Configure open-drain or open-source GPIO modes for multi-device bus protocols. - Build device drivers or system utilities that interact with GPIO character devices. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python bindings for libgpiod, the official Linux GPIO character device interface library, enabling control of GPIO lines with support for event polling, multi-value operations, and open-source/open-drain modes. Yes, if you need to control GPIO on Linux. It is the official, actively maintained binding to the modern kernel interface, supports current Python versions (3.10–3.14), has no known vulnerabilities, and provides binary wheels for common platforms. The copyleft license is standard for GPIO libraries and acceptable in most open-source contexts. Install friction is moderate but manageable with python3-dev. ## Install pip install gpiod uv add gpiod poetry add gpiod ## Installing gpiod Before you install: Medium install friction due to binary wheel availability for common platforms (Python 3.10–3.14 on x86_64 and aarch64 Linux) but source builds require python3-dev. Active maintenance with recent release (58 days ago) and ongoing repository activity. License in practice: LGPL-2.1-or-later copyleft license requires derivative works and linked applications to disclose source code under compatible terms; acceptable for open-source projects but may constrain proprietary deployments. Quickstart: pip install gpiod import gpiod from gpiod.line import Direction, Value with gpiod.request_lines( "/dev/gpiochip0", consumer="example", config={0: gpiod.LineSettings(direction=Direction.OUTPUT)} ) as request: request.set_value(0, Value.ACTIVE) Requires python3-dev; source builds need libgpiod headers. Binary wheels available for Python 3.10–3.14 on Linux x86_64 and aarch64. Root access needed to interact with /dev/gpiochip* devices. Verify before relying: - Whether free-threaded CPython support (mentioned in description) is production-ready or experimental. - Performance characteristics and latency guarantees for GPIO event polling under load. - Compatibility with non-Linux POSIX systems or Windows via WSL. - Whether vendored libgpiod can be overridden with system package via LINK_SYSTEM_LIBGPIOD=1. ## Package facts - License: LGPL-2.1-or-later (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 643.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags GPIO control Linux Python, libgpiod Python bindings, GPIO character device interface, Raspberry Pi GPIO library, Linux GPIO line control, GPIO event polling, embedded GPIO management, gpio-control, embedded-systems, linux-hardware [View on SkillFed](https://skillfed.io/packages/gpiod) · [View on PyPI](https://pypi.org/project/gpiod/)