gpiod
Python bindings for libgpiod
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
License · maintenance · safety
LGPL-2.1-or-later (copyleft) — 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.
last release 2026-06-17 (58 days) · last repo commit 2026-07-20 · 438 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 643,433 downloads/mo, #5,607 on PyPI
Alternatives
Verify before relying
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)- 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.
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 on this page. Verify before relying on it.
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
gpiod on PyPI
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.
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.
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)
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 the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 58 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 643,433 / month, #5,607 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 3 - StableTyping :: Typed |
Evidence: gpiod-2.5.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; gpiod-2.5.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; gpiod-2.5.0-cp310-cp310-musllinux_1_2_aarch64.whl; gpiod-2.5.0-cp310-cp310-musllinux_1_2_x86_64.whl; gpiod-2.5.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; gpiod-2.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; gpiod-2.5.0-cp311-cp311-musllinux_1_2_aarch64.whl; gpiod-2.5.0-cp311-cp311-musllinux_1_2_x86_64.whl; gpiod-2.5.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; gpiod-2.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; gpiod-2.5.0-cp312-cp312-musllinux_1_2_aarch64.whl; gpiod-2.5.0-cp312-cp312-musllinux_1_2_x86_64.whl; gpiod-2.5.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; gpiod-2.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; gpiod-2.5.0-cp313-cp313-musllinux_1_2_aarch64.whl; gpiod-2.5.0-cp313-cp313-musllinux_1_2_x86_64.whl; gpiod-2.5.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; gpiod-2.5.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; gpiod-2.5.0-cp314-cp314-musllinux_1_2_aarch64.whl; gpiod-2.5.0-cp314-cp314-musllinux_1_2_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “GPIO control Linux Python”
- gpiodPython bindings for libgpiod, the official Linux GPIO character…
- numato-gpioProvides a Python API to control Numato USB GPIO expander devices…
- RPi.GPIORPi.GPIO provides Python control over Raspberry Pi GPIO pins,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also RPi.GPIO · gpiozero · ft4222 · pigpio · pylibfdt · pyftdi · debug-mgr · libusbsio · numato-gpio · zigpy-zigate