The following table contains a comparison of popular Python GPIO Libraries for the Raspberry Pi.
Every effort has been made to ensure the accuracy of the information in the table. Please post a comment if you feel any of the information needs amending, can suggest the inclusion of another GPIO library or would like to contribute in any way.
OCTOBER 2019 – Please note this table is currently work-in-progress. LED + Button code examples for each library is also in progress.
Feature Descriptions
Pin Numbering Schemes
GPIO libraries use different numbering schemes for referencing GPIO Pins and interfaces in code, including:
- Broadcom or BCM numbering is the most common and refers to the numbering matching the Raspberry Pi’s Broadcom chip. When we say “GPIO 23”, it’s usually this scheme that we are referring to by default.
- Physical numbering refers to the physical Pin number on the Raspberry Pi’s P1 header.
- WiringPi numbering is a mapping scheme created for the WiringPi library.
For more on numbering schemes see Raspberry Pi Pin Numbering Schemes.
PWM Techniques
Different GPIO libraries produce PWM signals using a number of different techniques, which include:
- Software PWM produces PWM pulses in code by pulsing a GPIO pin on and off. This is the least accurate way of generating PWM because it is subject to distortion if the host’s CPU is busy. Software PWM is available on any GPIO pin.
- Hardware Timed PWM uses the Raspberry Pi’s DMA / PCM peripherals to more accurately time PWM pulses. It is highly accurate and is available with the PiGPIO library. It is available on any GPIO Pin but comes with the limitation of only working with a defined set of frequencies.
- Hardware PWM is extremely accurate. It uses dedicated PWM hardware available in the Raspberry Pi to generate PWM signals. It is only available on designated GPIO pins that have PWM channels as their alternative function.
For more on PWM techniques see Raspberry Pi PWM Techniques.
Remote GPIO
Remote GPIO is a unique feature of the PiGPIO library that allows you to control a Raspberry Pi’s GPIO Pins over a network from any computer.
For more informtion see Raspberry Pi Remote GPIO.
Additional Resources
Pending…
James says
Thank you for compiling this useful table it’s be best and most complete I have found. I look forward to nore tables and the code for comparison.