skillfed

RPi.GPIO

A module to control Raspberry Pi GPIO channels

rpi-gpio v0.7.1 97.6K downloads/30d#13,143 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

RPi.GPIO is a Python module for controlling GPIO pins on Raspberry Pi hardware. It allows you to set pins as inputs or outputs, read digital states, detect rising/falling edges with callbacks, and generate software PWM signals. The module provides both BCM (Broadcom GPIO numbering) and BOARD (physical pin numbering) modes, plus pull-up/pull-down resistor configuration on input pins.

The package is a C extension that accesses GPIO hardware via /dev/gpiomem (or /dev/mem as fallback), avoiding the need for root privileges in most cases. However, the author explicitly warns that it is unsuitable for real-time or timing-critical applications because Python's garbage collection and Linux kernel multitasking introduce unpredictable jitter. The package does not support SPI, I2C, hardware PWM, or serial functionality—only digital I/O and software PWM are available.

Use it for:

  • Control LEDs, relays, and other digital outputs on a Raspberry Pi project
  • Detect button presses and other digital input events with edge-triggered callbacks
  • Generate PWM signals for motor speed control or LED brightness using software PWM
  • Implement home automation or IoT projects requiring GPIO-based sensor/actuator control
  • Read sensor states and respond to state changes in hobbyist robotics applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

RPi.GPIO provides Python control over Raspberry Pi GPIO pins, supporting digital input/output, edge detection, and software PWM on all channels.

No, not for new projects. The package is abandoned (no updates for 1650 days) and explicitly unsuitable for timing-critical work. Install only if you are maintaining legacy code already using RPi.GPIO. For new Raspberry Pi GPIO projects, consider actively maintained alternatives.

Install

rpi-gpio on PyPI

pip

pip install rpi-gpio

uv

uv add rpi-gpio

poetry

poetry add rpi-gpio

Installing RPi.GPIO

Before you install

Medium install friction due to platform-specific wheels (linux_armv6l only) and C extension compilation requirements. Package is abandoned as of 1650 days since last release, with no active maintenance or repository updates.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO.OUT)
GPIO.output(GPIO.HIGH)
GPIO.cleanup()

Requires running on Raspberry Pi hardware with Linux kernel; not suitable for real-time or timing-critical applications due to Python garbage collection and kernel multitasking jitter.

Verify before relying

  • Whether the package works reliably on current Raspberry Pi models (last tested with Python 3.10, released 2022-02-06)
  • Compatibility with modern Raspberry Pi OS distributions and kernel versions
  • Whether SPI, I2C, hardware PWM, serial, or one-wire functionality mentioned as 'planned' was ever implemented

Package facts

License MIT (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance abandoned — 1,650 days since the last release
First released
Downloads 97,601/month — #13,143 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: RPi.GPIO-0.7.1-cp27-cp27mu-linux_armv6l.whl; RPi.GPIO-0.7.1-cp310-cp310-linux_armv6l.whl; RPi.GPIO-0.7.1-cp37-cp37m-linux_armv6l.whl; RPi.GPIO-0.7.1-cp38-cp38-linux_armv6l.whl; RPi.GPIO-0.7.1-cp39-cp39-linux_armv6l.whl

Keywords: Raspberry, Pi, GPIO

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Home AutomationTopic :: Software DevelopmentTopic :: System :: Hardware

Tags

raspberry pi gpio control pythonrpi pin control libraryraspberry pi digital iogpio edge detection eventssoftware pwm raspberry pirpi board pin setupraspberry pi hardware interface
raspberry-pigpio-controlabandoned

More Software Development packages