libgpiod Python bindings API

The libgpiod Python bindings provide an interface to control and interact with GPIO (General-Purpose Input/Output) lines on Linux systems using the libgpiod library. The Python bindings allow developers to manage GPIO pins easily through Python scripts, enabling tasks such as reading input values, setting outputs, monitoring events, and configuring more fine-grained pin options.

The Python bindings, much like the C API they wrap, are not thread-safe and do require external synchronization by the caller to serialize access to objects shared across threads.

The bindings support both GIL-enabled and free-threaded CPython interpreters.

Note

Python bindings require python3 support and libpython development files for building from sources.

Note

Python bindings can be installed from https://pypi.org/ with pip by running pip install gpiod.