========
gpiozero
========
A simple interface to GPIO devices with `Raspberry Pi`_, developed and maintained
by `Ben Nuttall`_ and `Dave Jones`_.
.. _Raspberry Pi: https://www.raspberrypi.org/
.. _Ben Nuttall: https://github.com/bennuttall
.. _Dave Jones: https://github.com/waveform80
About
=====
Component interfaces are provided to allow a frictionless way to get started
with physical computing:
.. code:: python
from gpiozero import LED
from time import sleep
led = LED(17)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
With very little code, you can quickly get going connecting your components
together:
.. code:: python
from gpiozero import LED, Button
from signal import pause
led = LED(17)
button = Button(3)
button.when_pressed = led.on
button.when_released = led.off
pause()
You can advance to using the declarative paradigm along with provided
to describe the behaviour of devices and their interactions:
.. code:: python
from gpiozero import OutputDevice, MotionSensor, LightSensor
from gpiozero.tools import booleanized, all_values
from signal import pause
garden = OutputDevice(17)
motion = MotionSensor(4)
light = LightSensor(5)
garden.source = all_values(booleanized(light, 0, 0.1), motion)
pause()
See the chapter on `Source/Values`_ for more information.
.. _Source/Values: https://gpiozero.readthedocs.io/en/stable/source_values.html
The library includes interfaces to many simple everyday components, as well as
some more complex things like sensors, analogue-to-digital converters, full
colour LEDs, robotics kits and more. See the `Recipes`_ chapter of the
documentation for ideas on how to get started.
.. _Recipes: https://gpiozero.readthedocs.io/en/stable/recipes.html
Pin factories
=============
GPIO Zero builds on a number of underlying pin libraries, including `RPi.GPIO`_
and `pigpio`_, each with their own benefits. You can select a particular pin
library to be used, either for the whole script or per-device, according to your
needs. See the section on `changing the pin factory`_.
.. _RPi.GPIO: https://pypi.org/project/RPi.GPIO
.. _pigpio: https://pypi.org/project/pigpio
.. _changing the pin factory: https://gpiozero.readthedocs.io/en/stable/api_pins.html#changing-the-pin-factory
A "mock pin" interface is also provided for testing purposes. Read more about
this in the section on `mock pins`_.
.. _mock pins: https://gpiozero.readthedocs.io/en/stable/api_pins.html#mock-pins
Installation
============
GPIO Zero is installed by default in the Raspberry Pi OS desktop image,
available from `raspberrypi.org`_. To install on Raspberry Pi OS Lite or other
operating systems, including for PCs using remote GPIO, see the `Installing`_
chapter.
.. _raspberrypi.org: https://www.raspberrypi.org/software/
.. _Installing: https://gpiozero.readthedocs.io/en/stable/installing.html
Documentation
=============
Comprehensive documentation is available at https://gpiozero.readthedocs.io/.
Please refer to the `Contributing`_ and `Development`_ chapters in the
documentation for information on contributing to the project.
.. _Contributing: https://gpiozero.readthedocs.io/en/stable/contributing.html
.. _Development: https://gpiozero.readthedocs.io/en/stable/development.html
Issues and questions
====================
If you have a feature request or bug report, please open an `issue on GitHub`_.
If you have a question or need help, this may be better suited to our `GitHub
discussion board`_, the `Raspberry Pi Stack Exchange`_ or the `Raspberry Pi
Forums`_.
.. _issue on GitHub: https://github.com/gpiozero/gpiozero/issues/new
.. _GitHub discussion board: https://github.com/gpiozero/gpiozero/discussions
.. _Raspberry Pi Stack Exchange: https://raspberrypi.stackexchange.com/
.. _Raspberry Pi Forums: https://www.raspberrypi.org/forums/
Python 2 support
================
.. warning::
GPIO Zero 1.6.x is the last to support Python 2. GPIO Zero 2.x will support
Python 3 only.
Contributors
============
- `Alex Chan`_
- `Alex Eames`_
- `Andrew Scheller`_
- `Barry Byford`_
- `Carl Monk`_
- `Claire Pollard`_
- `Clare Macrae`_
- `Dan Jackson`_
- `Daniele Procida`_
- `damosurfer`_
- `David Glaude`_
- `Delcio Torres`_
- `Edward Betts`_
- `Fatih Sarhan`_
- `G.S.`_
- `Ian Harcombe`_
- `Jack Wearden`_
- `Jeevan M R`_
- `Josh Thorpe`_
- `Kyle Morgan`_
- `Linus Groh`_
- `Mahallon`_
- `Maksim Levental`_
- `Martchus`_
- `Martin O'Hanlon`_
- `Mike Kazantsev`_
- `Paulo Mateus`_
- `Phil Howard`_
- `Philippe Muller`_
- `Rick Ansell`_
- `Robert Erdin`_
- `Russel Winder`_
- `Ryan Walmsley`_
- `Schelto van Doorn`_
- `Sofiia Kosovan`_
- `Steve Amor`_
- `Stewart Adcock`_
- `Thijs Triemstra`_
- `Tim Golden`_
- `Yisrael Dov Lebow`_
See the `contributors page`_ on GitHub for more info.
.. _Alex Chan: https://github.com/gpiozero/gpiozero/commits?author=alexwlchan
.. _Alex Eames: https://github.com/gpiozero/gpiozero/commits?author=raspitv
.. _Andrew Scheller: https://github.com/gpiozero/gpiozero/commits?author=lurch
.. _Barry Byford: https://github.com/gpiozero/gpiozero/commits?author=ukBaz
.. _Carl Monk: https://github.com/gpiozero/gpiozero/commits?author=ForToffee
.. _Chris R: https://github.com/gpiozero/gpiozero/commits?author=chrisruk
.. _Claire Pollard: https://github.com/gpiozero/gpiozero/commits?author=tuftii
.. _Clare Macrae: https://github.com/gpiozero/gpiozero/commits?author=claremacrae
.. _Dan Jackson: https://github.com/gpiozero/gpiozero/commits?author=e28eta
.. _Daniele Procida: https://github.com/evildmp
.. _Dariusz Kowalczyk: https://github.com/gpiozero/gpiozero/commits?author=darton
.. _damosurfer: https://github.com/gpiozero/gpiozero/commits?author=damosurfer
.. _David Glaude: https://github.com/gpiozero/gpiozero/commits?author=dglaude
.. _Delcio Torres: https://github.com/gpiozero/gpiozero/commits?author=delciotorres
.. _Edward Betts: https://github.com/gpiozero/gpiozero/commits?author=edwardbetts
.. _Fatih Sarhan: https://github.com/gpiozero/gpiozero/commits?author=f9n
.. _G.S.: https://github.com/gpiozero/gpiozero/commits?author=gszy
.. _Ian Harcombe: https://github.com/gpiozero/gpiozero/commits?author=MrHarcombe
.. _Jack Wearden: https://github.com/gpiozero/gpiozero/commits?author=NotBobTheBuilder
.. _Jeevan M R: https://github.com/gpiozero/gpiozero/commits?author=jee1mr
.. _Josh Thorpe: https://github.com/gpiozero/gpiozero/commits?author=ThorpeJosh
.. _Kyle Morgan: https://github.com/gpiozero/gpiozero/commits?author=knmorgan
.. _Linus Groh: https://github.com/gpiozero/gpiozero/commits?author=linusg
.. _Mahallon: https://github.com/gpiozero/gpiozero/commits?author=Mahallon
.. _Maksim Levental: https://github.com/gpiozero/gpiozero/commits?author=makslevental
.. _Martchus: https://github.com/gpiozero/gpiozero/commits?author=Martchus
.. _Martin O'Hanlon: https://github.com/martinohanlon/commits?author=martinohanlon
.. _Mike Kazantsev: https://github.com/gpiozero/gpiozero/commits?author=mk-fg
.. _Paulo Mateus: https://github.com/gpiozero/gpiozero/commits?author=SrMouraSilva
.. _Phil Howard: https://github.com/gpiozero/gpiozero/commits?author=Gadgetoid
.. _Philippe Muller: https://github.com/gpiozero/gpiozero/commits?author=pmuller
.. _Rick Ansell: https://github.com/gpiozero/gpiozero/commits?author=ricksbt
.. _Robert Erdin: https://github.com/gpiozero/gpiozero/commits?author=roberterdin
.. _Russel Winder: https://github.com/russel
.. _Ryan Walmsley: https://github.com/gpiozero/gpiozero/commits?author=ryanteck
.. _Schelto van Doorn: https://github.com/gpiozero/gpiozero/commits?author=goloplo
.. _Sofiia Kosovan: https://github.com/gpiozero/gpiozero/commits?author=SofiiaKosovan
.. _Steve Amor: https://github.com/gpiozero/gpiozero/commits?author=SteveAmor
.. _Stewart Adcock: https://github.com/gpiozero/gpiozero/commits?author=stewartadcock
.. _Thijs Triemstra: https://github.com/gpiozero/gpiozero/commits?author=thijstriemstra
.. _Tim Golden: https://github.com/gpiozero/gpiozero/commits?author=tjguk
.. _Yisrael Dov Lebow: https://github.com/gpiozero/gpiozero/commits?author=yisraeldov
.. _contributors page: https://github.com/gpiozero/gpiozero/graphs/contributors
Raw data
{
"_id": null,
"home_page": "https://github.com/gpiozero/gpiozero",
"name": "gpiozero",
"maintainer": "",
"docs_url": "https://pythonhosted.org/gpiozero/",
"requires_python": "",
"maintainer_email": "",
"keywords": "raspberrypi,gpio",
"author": "Ben Nuttall",
"author_email": "ben@bennuttall.com",
"download_url": "https://files.pythonhosted.org/packages/86/e1/88d1fde5ce042a12e231ff032ae1aace89670ad15497672b28a6eb5699e9/gpiozero-1.6.2.tar.gz",
"platform": "ALL",
"description": "========\ngpiozero\n========\n\nA simple interface to GPIO devices with `Raspberry Pi`_, developed and maintained\nby `Ben Nuttall`_ and `Dave Jones`_.\n\n.. _Raspberry Pi: https://www.raspberrypi.org/\n.. _Ben Nuttall: https://github.com/bennuttall\n.. _Dave Jones: https://github.com/waveform80\n\nAbout\n=====\n\nComponent interfaces are provided to allow a frictionless way to get started\nwith physical computing:\n\n.. code:: python\n\n from gpiozero import LED\n from time import sleep\n\n led = LED(17)\n\n while True:\n led.on()\n sleep(1)\n led.off()\n sleep(1)\n\nWith very little code, you can quickly get going connecting your components\ntogether:\n\n.. code:: python\n\n from gpiozero import LED, Button\n from signal import pause\n\n led = LED(17)\n button = Button(3)\n\n button.when_pressed = led.on\n button.when_released = led.off\n\n pause()\n\nYou can advance to using the declarative paradigm along with provided\nto describe the behaviour of devices and their interactions:\n\n.. code:: python\n\n from gpiozero import OutputDevice, MotionSensor, LightSensor\n from gpiozero.tools import booleanized, all_values\n from signal import pause\n\n garden = OutputDevice(17)\n motion = MotionSensor(4)\n light = LightSensor(5)\n\n garden.source = all_values(booleanized(light, 0, 0.1), motion)\n\n pause()\n\nSee the chapter on `Source/Values`_ for more information.\n\n.. _Source/Values: https://gpiozero.readthedocs.io/en/stable/source_values.html\n\nThe library includes interfaces to many simple everyday components, as well as\nsome more complex things like sensors, analogue-to-digital converters, full\ncolour LEDs, robotics kits and more. See the `Recipes`_ chapter of the\ndocumentation for ideas on how to get started.\n\n.. _Recipes: https://gpiozero.readthedocs.io/en/stable/recipes.html\n\nPin factories\n=============\n\nGPIO Zero builds on a number of underlying pin libraries, including `RPi.GPIO`_\nand `pigpio`_, each with their own benefits. You can select a particular pin\nlibrary to be used, either for the whole script or per-device, according to your\nneeds. See the section on `changing the pin factory`_.\n\n.. _RPi.GPIO: https://pypi.org/project/RPi.GPIO\n.. _pigpio: https://pypi.org/project/pigpio\n.. _changing the pin factory: https://gpiozero.readthedocs.io/en/stable/api_pins.html#changing-the-pin-factory\n\nA \"mock pin\" interface is also provided for testing purposes. Read more about\nthis in the section on `mock pins`_.\n\n.. _mock pins: https://gpiozero.readthedocs.io/en/stable/api_pins.html#mock-pins\n\nInstallation\n============\n\nGPIO Zero is installed by default in the Raspberry Pi OS desktop image,\navailable from `raspberrypi.org`_. To install on Raspberry Pi OS Lite or other\noperating systems, including for PCs using remote GPIO, see the `Installing`_\nchapter.\n\n.. _raspberrypi.org: https://www.raspberrypi.org/software/\n.. _Installing: https://gpiozero.readthedocs.io/en/stable/installing.html\n\nDocumentation\n=============\n\nComprehensive documentation is available at https://gpiozero.readthedocs.io/.\nPlease refer to the `Contributing`_ and `Development`_ chapters in the\ndocumentation for information on contributing to the project.\n\n.. _Contributing: https://gpiozero.readthedocs.io/en/stable/contributing.html\n.. _Development: https://gpiozero.readthedocs.io/en/stable/development.html\n\nIssues and questions\n====================\n\nIf you have a feature request or bug report, please open an `issue on GitHub`_.\nIf you have a question or need help, this may be better suited to our `GitHub\ndiscussion board`_, the `Raspberry Pi Stack Exchange`_ or the `Raspberry Pi\nForums`_.\n\n.. _issue on GitHub: https://github.com/gpiozero/gpiozero/issues/new\n.. _GitHub discussion board: https://github.com/gpiozero/gpiozero/discussions\n.. _Raspberry Pi Stack Exchange: https://raspberrypi.stackexchange.com/\n.. _Raspberry Pi Forums: https://www.raspberrypi.org/forums/\n\nPython 2 support\n================\n\n.. warning::\n\n GPIO Zero 1.6.x is the last to support Python 2. GPIO Zero 2.x will support\n Python 3 only.\n\nContributors\n============\n\n- `Alex Chan`_\n- `Alex Eames`_\n- `Andrew Scheller`_\n- `Barry Byford`_\n- `Carl Monk`_\n- `Claire Pollard`_\n- `Clare Macrae`_\n- `Dan Jackson`_\n- `Daniele Procida`_\n- `damosurfer`_\n- `David Glaude`_\n- `Delcio Torres`_\n- `Edward Betts`_\n- `Fatih Sarhan`_\n- `G.S.`_\n- `Ian Harcombe`_\n- `Jack Wearden`_\n- `Jeevan M R`_\n- `Josh Thorpe`_\n- `Kyle Morgan`_\n- `Linus Groh`_\n- `Mahallon`_\n- `Maksim Levental`_\n- `Martchus`_\n- `Martin O'Hanlon`_\n- `Mike Kazantsev`_\n- `Paulo Mateus`_\n- `Phil Howard`_\n- `Philippe Muller`_\n- `Rick Ansell`_\n- `Robert Erdin`_\n- `Russel Winder`_\n- `Ryan Walmsley`_\n- `Schelto van Doorn`_\n- `Sofiia Kosovan`_\n- `Steve Amor`_\n- `Stewart Adcock`_\n- `Thijs Triemstra`_\n- `Tim Golden`_\n- `Yisrael Dov Lebow`_\n\nSee the `contributors page`_ on GitHub for more info.\n\n.. _Alex Chan: https://github.com/gpiozero/gpiozero/commits?author=alexwlchan\n.. _Alex Eames: https://github.com/gpiozero/gpiozero/commits?author=raspitv\n.. _Andrew Scheller: https://github.com/gpiozero/gpiozero/commits?author=lurch\n.. _Barry Byford: https://github.com/gpiozero/gpiozero/commits?author=ukBaz\n.. _Carl Monk: https://github.com/gpiozero/gpiozero/commits?author=ForToffee\n.. _Chris R: https://github.com/gpiozero/gpiozero/commits?author=chrisruk\n.. _Claire Pollard: https://github.com/gpiozero/gpiozero/commits?author=tuftii\n.. _Clare Macrae: https://github.com/gpiozero/gpiozero/commits?author=claremacrae\n.. _Dan Jackson: https://github.com/gpiozero/gpiozero/commits?author=e28eta\n.. _Daniele Procida: https://github.com/evildmp\n.. _Dariusz Kowalczyk: https://github.com/gpiozero/gpiozero/commits?author=darton\n.. _damosurfer: https://github.com/gpiozero/gpiozero/commits?author=damosurfer\n.. _David Glaude: https://github.com/gpiozero/gpiozero/commits?author=dglaude\n.. _Delcio Torres: https://github.com/gpiozero/gpiozero/commits?author=delciotorres\n.. _Edward Betts: https://github.com/gpiozero/gpiozero/commits?author=edwardbetts\n.. _Fatih Sarhan: https://github.com/gpiozero/gpiozero/commits?author=f9n\n.. _G.S.: https://github.com/gpiozero/gpiozero/commits?author=gszy\n.. _Ian Harcombe: https://github.com/gpiozero/gpiozero/commits?author=MrHarcombe\n.. _Jack Wearden: https://github.com/gpiozero/gpiozero/commits?author=NotBobTheBuilder\n.. _Jeevan M R: https://github.com/gpiozero/gpiozero/commits?author=jee1mr\n.. _Josh Thorpe: https://github.com/gpiozero/gpiozero/commits?author=ThorpeJosh\n.. _Kyle Morgan: https://github.com/gpiozero/gpiozero/commits?author=knmorgan\n.. _Linus Groh: https://github.com/gpiozero/gpiozero/commits?author=linusg\n.. _Mahallon: https://github.com/gpiozero/gpiozero/commits?author=Mahallon\n.. _Maksim Levental: https://github.com/gpiozero/gpiozero/commits?author=makslevental\n.. _Martchus: https://github.com/gpiozero/gpiozero/commits?author=Martchus\n.. _Martin O'Hanlon: https://github.com/martinohanlon/commits?author=martinohanlon\n.. _Mike Kazantsev: https://github.com/gpiozero/gpiozero/commits?author=mk-fg\n.. _Paulo Mateus: https://github.com/gpiozero/gpiozero/commits?author=SrMouraSilva\n.. _Phil Howard: https://github.com/gpiozero/gpiozero/commits?author=Gadgetoid\n.. _Philippe Muller: https://github.com/gpiozero/gpiozero/commits?author=pmuller\n.. _Rick Ansell: https://github.com/gpiozero/gpiozero/commits?author=ricksbt\n.. _Robert Erdin: https://github.com/gpiozero/gpiozero/commits?author=roberterdin\n.. _Russel Winder: https://github.com/russel\n.. _Ryan Walmsley: https://github.com/gpiozero/gpiozero/commits?author=ryanteck\n.. _Schelto van Doorn: https://github.com/gpiozero/gpiozero/commits?author=goloplo\n.. _Sofiia Kosovan: https://github.com/gpiozero/gpiozero/commits?author=SofiiaKosovan\n.. _Steve Amor: https://github.com/gpiozero/gpiozero/commits?author=SteveAmor\n.. _Stewart Adcock: https://github.com/gpiozero/gpiozero/commits?author=stewartadcock\n.. _Thijs Triemstra: https://github.com/gpiozero/gpiozero/commits?author=thijstriemstra\n.. _Tim Golden: https://github.com/gpiozero/gpiozero/commits?author=tjguk\n.. _Yisrael Dov Lebow: https://github.com/gpiozero/gpiozero/commits?author=yisraeldov\n\n.. _contributors page: https://github.com/gpiozero/gpiozero/graphs/contributors\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A simple interface to GPIO devices with Raspberry Pi.",
"version": "1.6.2",
"project_urls": {
"Homepage": "https://github.com/gpiozero/gpiozero"
},
"split_keywords": [
"raspberrypi",
"gpio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c0fafd051ec230fb841476a626662e31f580756811ad70392f3ee6ae56ad52a9",
"md5": "591345f627648d5e4b0b36d7acb6149a",
"sha256": "9af00b90d4fa775aa1fc023363e4aa5539844a5b0c461be5ced5cfabba364d99"
},
"downloads": -1,
"filename": "gpiozero-1.6.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "591345f627648d5e4b0b36d7acb6149a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 148903,
"upload_time": "2021-03-18T18:23:48",
"upload_time_iso_8601": "2021-03-18T18:23:48.051599Z",
"url": "https://files.pythonhosted.org/packages/c0/fa/fd051ec230fb841476a626662e31f580756811ad70392f3ee6ae56ad52a9/gpiozero-1.6.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "86e188d1fde5ce042a12e231ff032ae1aace89670ad15497672b28a6eb5699e9",
"md5": "45dcebab7e92050dcbcf72fb74153468",
"sha256": "0eb95a9db372146813276f92de7f43c883a3e9fe69597fc3d29c04ef3d5d5f9e"
},
"downloads": -1,
"filename": "gpiozero-1.6.2.tar.gz",
"has_sig": false,
"md5_digest": "45dcebab7e92050dcbcf72fb74153468",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 167968,
"upload_time": "2021-03-18T18:23:50",
"upload_time_iso_8601": "2021-03-18T18:23:50.053485Z",
"url": "https://files.pythonhosted.org/packages/86/e1/88d1fde5ce042a12e231ff032ae1aace89670ad15497672b28a6eb5699e9/gpiozero-1.6.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-03-18 18:23:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gpiozero",
"github_project": "gpiozero",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "gpiozero"
}