Skip to main content

Python client for Relayr API

Project description

Welcome to the relayr Python Library. The repository provides you Python developers with programmatic access points to the relayr platform.

These include access to the relayr cloud via the relayr API as well as direct connection to the relayr WunderBar sensors, via Bluetooth Low Energy (using BlueZ on Linux).

Installation

You can install the library using one of the following methods, with the help of Pip:

  1. You can download the very latest version of the repository from GitHub:

    pip install git+https://github.com/relayr/python-sdk
  2. You may use the following to install the package from the Python Package Index:

    pip install relayr

Examples

Receive data for 10 seconds from a private device of your WunderBar (you can obtain your device IDs e.g. from your relayr Dashboard):

import time
from relayr import Client
c = Client(token='<my_access_token>')
dev = c.get_device(id='<my_device_id>').get_info()
user = c.get_user()
app = c.get_app()
def callback(message, channel):
    print(repr(message), type(message))
conn = user.connect_device(app, dev, callback)
conn.start()
time.sleep(10)
conn.stop()

Switch on/off an LED light on a device:

from relayr import Client
c = Client(token='<my_access_token>')
d = c.get_device(id='<my_device_id>')
d.switch_led_on(True)

Documentation

For references to the full documenation for the Python library please visit our Developer Dashboard Python section!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relayr-0.2.2.tar.gz (222.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page