Skip to main content

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.

Release files for fake-rpigpio 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fake-rpigpio 0.1.1
File Size Uploaded
fake_rpigpio-0.1.1.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fake-rpigpio 0.1.1
File Interpreter ABI Platform
fake_rpigpio-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / fake_rpigpio-0.1.1.tar.gz

Download URL fake_rpigpio-0.1.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd723b85b807e813a229f737bc0ac691bc4deb2fb9a0d2e97de99365dd18981a
BLAKE2b-256 checksum
How to use checksums
5dcb4475d64953a0275b48f3db4a75e5dcc5f122fc65254d3814859177030954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

Release files / fake_rpigpio-0.1.1-py3-none-any.whl

Download URL fake_rpigpio-0.1.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e5efc6c5982267380d19b3ecf652aeb3e97c8377d9b4d5dd950801a4b8b7863
BLAKE2b-256 checksum
How to use checksums
577957280914374c89e87eb1862b0c42fdc87d668f2efc729c8b7831b7e97f4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page