Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Fake Raspberry PI GPIO drop-in replacement for RPi.GPIO

Project description

fake-rpigpio

fake-rpigpio is a package intended to provide a lightweight (dependency-free) fake interface for Raspberry Pi GPIO. The GPIO functions match those in the RPi.GPIO library, however the functions do nothing. This makes it easier to test GPIO-related code and to get the code to run on non-pi machines.

Installation

This package can be installed via pip:

pip install fake-rpigpio

Usage

A basic example of using this package to run with RPi.GPIO on a Pi and fake-rpigpio on a non-Pi:

try:
    import RPi.GPIO
except (RuntimeError, ModuleNotFoundError):
    import fake_rpigpio.utils
    fake_rpigpio.utils.install()

This will install fake-rpigpio.RPi as RPi and fake-rpigpio.RPi.GPIO as RPi.GPIO, so you should not need to change imports for the RPi.GPIO library.

Acknowledgements

The following projects inspired this one. While all are similar, the usage and dependency weight varies between projects.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fake-rpigpio, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size fake_rpigpio-0.1.0-py3-none-any.whl (15.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size fake_rpigpio-0.1.0.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page