Skip to main content

data-shipper

Device Python Client SDK beta

Install

pip install cyberfly-data-shipper

Usage

To use this python client you need following things

  1. KeyPairs
  2. Device ID

Create Key pair for device

python3 -c "from pypact.pact import Pact;kp=Pact().crypto.gen_key_pair();print(kp)"

Create device in Cyberfly IO platform to obtain device id (uuid)

Template

from data_shipper.main import CyberflyDataShipper
key_pair = {"publicKey": "your public key",
            "secretKey": "your secret key"}

client = CyberflyDataShipper(device_id="093062d0-a357-4f8a-a1cb-35f1b43c12ae", 
                             key_pair=key_pair, network_id="testnet04")


@client.on_message()
def do_something(data):
    #print(data)
    pass

while 1:
    #send data
    pass

Raspberry pi LED example

import time
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, network_id="testnet04")

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:
    # read data from sensor and process
    client.process_data({"temperature": 36})
    time.sleep(5) # time delay set as you want

Metadata

Release files for cyberfly-data-shipper 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cyberfly-data-shipper 0.2.7
File Size Uploaded Provenance Actions
cyberfly-data-shipper-0.2.7.tar.gz 4.6 kB Without provenance Details for cyberfly-data-shipper-0.2.7.tar.gz

Release files / cyberfly-data-shipper-0.2.7.tar.gz

Download URL cyberfly-data-shipper-0.2.7.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63d6b7ff13d70cb0e9cc3691a7815efaf1692014c2c734fba92442f02a489547
BLAKE2b-256 checksum
How to use checksums
6b6b2a3160faf492eaa72728f53234de5bfee45d6eecca71741c9644e779a770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for cyberfly-data-shipper 0.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page