{ "info": { "author": "Jorge Capona", "author_email": "jcapona@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Topic :: Software Development", "Topic :: Software Development :: Embedded Systems", "Topic :: System" ], "description": "Raspberry Pi GPIO Api\n=====================\n\nAPI to access Raspberry Pi GPIO based on Python, Flask & Rpi.GPIO library. The software launches an web API that controls IO pins using the `Rpi.GPIO` library.\n\nThis was meant to be used to remotely control relays, thus, it only sets the outputs as high or low.\n\nThe pins are referenced through their number printed in the board. Further information about pins can be found `here `_.\n\n\nAPI\n---\n\n+--------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Route | Request | Description |\n+==========================+=========+===================================================================================================================================================================================================================================================+\n| `/api/gpio/` | GET | Returns a json object with the status of all pins |\n+--------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| `/api/gpio/power/` | GET | Returns a json object with the power pins position and description (5V, 3V3, GND) |\n+--------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| `/api/gpio/io/` | GET | Returns a json object with de description and status for a pin. If no pin number is given, returns the status of all io pins. |\n+--------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| `/api/gpio/io/` | POST | Sets up a particular pin. Receives a json object that must have the keys `type` and `value`. `type` must be a string with either `input` or `output` and `value` must be a boolean, with the status to write to the channel of the request. |\n+--------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n\n\nSample response\n---------------\n\n.. code-block:: sh\n\n {\n \"io\": [\n {\n \"pin\": 3,\n \"pin_function\": \"IO\",\n \"pin_state\": 1\n },\n ...],\n\n \"power_pins\": [\n {\n \"pin\": 1,\n \"pin_function\": \"3V3 Power\"\n },\n ...]\n }\n\n\nInstallation\n------------\n\nLatest release through PyPI:\n\n.. code-block:: sh\n\n $ pip install pi_gpio_api\n\nDevelopment version:\n\n.. code-block:: sh\n\n $ git clone git@github.com:jcapona/pi-gpio-api.git\n $ cd pi-gpio-api\n $ pip install -e .\n\n\nCLI\n---\n\nThe api can be run as a daemon using the `gpioapi` command in the Raspberry Pi shell.\n\n.. code-block:: sh\n\n $ gpioapi -h\n usage: gpioapi [-h] [-H HOST] [-p PORT] command\n\n GPIO web API controller\n\n positional arguments:\n command Control process: start, stop, restart, status\n\n optional arguments:\n -h, --help show this help message and exit\n -H HOST, --host HOST host where the web server will be listening\n -p PORT, --port PORT port where the web server will be listening\n\nThis way, the API can be launched through `gpioapi start` and stopped through `gpioapi stop`.\n\n\nUse as a library\n----------------\n\nIn a python shell:\n\n.. code-block:: python\n\n >>> import pi_gpio_api\n >>> pi_gpio_api.app.run(host='0.0.0.0', port=5000)\n\nThis will launch a server that listens requests on the given host & port.\n\n\nContribution\n------------\n\nFeel free to open issues, report bugs or open pull requests.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jcapona/pi-gpio-api", "keywords": "raspberry pi api gpio io", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pi-gpio-api", "package_url": "https://pypi.org/project/pi-gpio-api/", "platform": "", "project_url": "https://pypi.org/project/pi-gpio-api/", "project_urls": { "Homepage": "https://github.com/jcapona/pi-gpio-api" }, "release_url": "https://pypi.org/project/pi-gpio-api/0.1.1/", "requires_dist": [ "click (==6.7)", "daemonocle (==1.0.1)", "docutils (==0.15.2)", "Flask (==0.12.2)", "itsdangerous (==0.24)", "Jinja2 (==2.9.6)", "lockfile (==0.12.2)", "MarkupSafe (==1.0)", "pigpio (==1.35)", "psutil (==5.6.3)", "RPi.GPIO (==0.7.0)", "Werkzeug (==0.12.2)" ], "requires_python": "", "summary": "web API to control Raspberry Pi GPIO", "version": "0.1.1" }, "last_serial": 5755051, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "de8375ba285bbbfbc5ea4e08e811377d", "sha256": "5457e4ddd302e0e37579ce8dd0584d079183d463d19a484656f89ec7cbf91f9a" }, "downloads": -1, "filename": "pi_gpio_api-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "de8375ba285bbbfbc5ea4e08e811377d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7821, "upload_time": "2019-08-28T20:13:15", "url": "https://files.pythonhosted.org/packages/f3/13/75979e0e80fe139197609f9e96d4ba7997832588e3f582c0b817baaf663e/pi_gpio_api-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2aea0b5a17426f802a32ea5b2fb4cf5a", "sha256": "8686d1aff46a77b88b6a728cb61cee61ba9581da6774ff84695d4fa639dbc691" }, "downloads": -1, "filename": "pi-gpio_api-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2aea0b5a17426f802a32ea5b2fb4cf5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6698, "upload_time": "2019-08-28T20:13:17", "url": "https://files.pythonhosted.org/packages/19/16/7f99673d7dec40df5e7ec429ae752bf66185a0ea9ab902af442b54f8508b/pi-gpio_api-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "73d9d06f5af0884bbcf8943d3bbedeab", "sha256": "4d51381383cd4af98888dae409c62d83af1cea8263e464ced58345605da9c09d" }, "downloads": -1, "filename": "pi_gpio_api-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "73d9d06f5af0884bbcf8943d3bbedeab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7833, "upload_time": "2019-08-29T15:56:40", "url": "https://files.pythonhosted.org/packages/7f/90/40cc7fd0eebadc90ddd773fdc01e71e1c21249641f3d7adbe5657d156909/pi_gpio_api-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "66d277d67b59c7abd120fd3aee2328ce", "sha256": "821a32299a48d282a201c1b8d5ae1b7e13486fb34c7a1f5c98934f9814c6bc2f" }, "downloads": -1, "filename": "pi-gpio_api-0.1.1.tar.gz", "has_sig": false, "md5_digest": "66d277d67b59c7abd120fd3aee2328ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6721, "upload_time": "2019-08-29T15:56:44", "url": "https://files.pythonhosted.org/packages/f9/24/b6ff5c791b736316cb3b5de5105320b3879d5299bd482c23110e1ccbec93/pi-gpio_api-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73d9d06f5af0884bbcf8943d3bbedeab", "sha256": "4d51381383cd4af98888dae409c62d83af1cea8263e464ced58345605da9c09d" }, "downloads": -1, "filename": "pi_gpio_api-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "73d9d06f5af0884bbcf8943d3bbedeab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7833, "upload_time": "2019-08-29T15:56:40", "url": "https://files.pythonhosted.org/packages/7f/90/40cc7fd0eebadc90ddd773fdc01e71e1c21249641f3d7adbe5657d156909/pi_gpio_api-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "66d277d67b59c7abd120fd3aee2328ce", "sha256": "821a32299a48d282a201c1b8d5ae1b7e13486fb34c7a1f5c98934f9814c6bc2f" }, "downloads": -1, "filename": "pi-gpio_api-0.1.1.tar.gz", "has_sig": false, "md5_digest": "66d277d67b59c7abd120fd3aee2328ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6721, "upload_time": "2019-08-29T15:56:44", "url": "https://files.pythonhosted.org/packages/f9/24/b6ff5c791b736316cb3b5de5105320b3879d5299bd482c23110e1ccbec93/pi-gpio_api-0.1.1.tar.gz" } ] }