https://github.com/projectweekend/gpiosvr
RESTful interfaces for Raspberry Pi GPIO
https://github.com/projectweekend/gpiosvr
python3 raspberry-pi
Last synced: 5 months ago
JSON representation
RESTful interfaces for Raspberry Pi GPIO
- Host: GitHub
- URL: https://github.com/projectweekend/gpiosvr
- Owner: projectweekend
- License: mit
- Created: 2017-12-10T06:49:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:51:44.000Z (over 3 years ago)
- Last Synced: 2025-11-27T14:56:50.742Z (7 months ago)
- Topics: python3, raspberry-pi
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gpiosvr
RESTful interfaces for Raspberry Pi GPIO
# Run an LED server
Create a module for Gunicorn.
**Example: `led_server.py`**
```python
from gpiosvr import led
from gpiozero import LED
pin_config = (('red', 5), ('yellow', 6), ('green', 13), )
application = led.create_server(pin_config=pin_config, led_factory=LED)
```
Start the server with Gunicorn, using your desired options.
```bash
$ gunicorn -b 127.0.0.1:8000 led_server
```
# Setup dev environment
```bash
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements-dev.txt
```
# Run tests with HTML coverage report
```bash
(venv) $ pytest --cov=gpiosvr --cov-report=html
```
# Publish to pypi
```bash
$ python setup.py sdist
$ twine upload dist/*
```