<commit_before>Relayr API
============

Library for Python 2 and 3 to communicate with the Relayr API. 

Dependencies
------------
Relayr depends on the Python packages requests and pubnub. Make sure you have it installed using `pip install -r requirements.txt`

How to use
----------
Before using it, make sure you generate an oauth token using the following steps:

  * Go to [API KEYS section on the Relayr developer dashboard](https://developer.relayr.io/dashboard/apps/myApps).
  * Click on `New API key`
  * Fill in `title`, `description` and click `next`
  * It will ask you about a callback url, click `next`
  * It will show you your app ID, client ID and secret, click on `finalize`
  * A new box will be added to the page with your newly generated app, click on the button `Generate Token`
  * A new field called `token` will be added to the box: that is the string you need!

With your newly generated Oauth token in one hand, take your temperature sensor and turn it on. Open a python console and type the following commands.


    >> import relayr
    >> from __future__ import print_function
    >> api = relayr.API("YOUR OAUTH TOKEN")
    >> tempsens = [dev for dev in api.devices if 'Thermometer' in dev.name][0]
    >> chan = tempsens.get_channel()
    >> chan.add_message_handler(print)
    >> chan.start()
<commit_msg>README: added what is currently supported<commit_after>Relayr API
============

Library for Python 2 and 3 to communicate with the Relayr API.

It currently supports:

 * Connecting to relayr cloud using Oauth
 * List available devices
 * Open channels with devices and get sensor readings pushed

Dependencies
------------
Relayr depends on the Python packages requests and pubnub. Make sure you have it installed using `pip install -r requirements.txt`

How to use
----------
Before using it, make sure you generate an oauth token using the following steps:

  * Go to [API KEYS section on the Relayr developer dashboard](https://developer.relayr.io/dashboard/apps/myApps).
  * Click on `New API key`
  * Fill in `title`, `description` and click `next`
  * It will ask you about a callback url, click `next`
  * It will show you your app ID, client ID and secret, click on `finalize`
  * A new box will be added to the page with your newly generated app, click on the button `Generate Token`
  * A new field called `token` will be added to the box: that is the string you need!

With your newly generated Oauth token in one hand, take your temperature sensor and turn it on. Open a python console and type the following commands.


    >> import relayr
    >> from __future__ import print_function
    >> api = relayr.API("YOUR OAUTH TOKEN")
    >> tempsens = [dev for dev in api.devices if 'Thermometer' in dev.name][0]
    >> chan = tempsens.get_channel()
    >> chan.add_message_handler(print)
    >> chan.start()

{'fraction_non_alphanumeric': 0.0927546377318866, 'fraction_numerical': 0.0021001050052502626, 'mean_word_length': 3.550955414012739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7332536', 'n_tokens_mistral': 810, 'n_tokens_neox': 778, 'n_words': 396}