No project description provided
Project description
data-shipper
Device Python Client SDK beta
Install
pip install cyberfly-data-shipper
Usage
Template
from data_shipper.main import CyberflyDataShipper
key_pair = {"publicKey": "your public key",
"secretKey": "your secret key"}
client = CyberflyDataShipper(device_id="test", key_pair=key_pair)
@client.on_message()
def do_something(data):
#print(data)
pass
while 1:
#send data
pass
Raspberry pi LED example
from data_shipper.main import CyberflyDataShipper
import RPi.GPIO as GPIO
key_pair = {"publicKey": "d04bbd8f403e583248aa461896bd7518113f89b85c98f3d9596bbfbf30df0bcb",
"secretKey": "a0ec3175c6c80e60bc8ef18bd7b73a631c507b9f0a42c973036c7f96d21b047a"}
client = CyberflyDataShipper(device_id="your device id from io platform", key_pair=key_pair)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
@client.on_message()
def do_something(data):
pin_no = data.get("pin_no")
state = data.get("state")
GPIO.setup(pin_no, GPIO.OUT)
if state:
GPIO.output(pin_no, GPIO.HIGH)
else:
GPIO.output(pin_no, GPIO.LOW)
while 1:
pass
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for cyberfly-data-shipper-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1eb136c006fa5739bacd1998108ae97e653b8bb79b4a448409b23d0039ecf12 |
|
MD5 | 29f3078256eef6348c1d3dd6e4b2a0cf |
|
BLAKE2b-256 | f0a2f373c29d0643140d508feac62058901c5ff76eb79fedb85e4173664f2680 |