Python Data Reader
This is a Python module currently built for python >= 2.7
See the documentation for the Initial State Read API.
Installation
Using the automated script
On a Unix based system: (including Raspberry Pi, Mac OS X, Ubuntu)
\curl -sSL https://get.initialstate.com/python-reader -o - | sudo bash
If you don't have curl you should get it:
sudo apt-get install curl
Using Package Management
The package is hosted in PyPI under the package name ISReader.
If you don't have pip:
-
(optional) Check if you have python setup tools installed:
if you don't see a version number come back, you should install setuptools:
$ sudo apt-get install python-setuptools -
(optional) Check if you have pip installed:
if you don't see a version number after running the above command, install pip using easy_install:
I've got pip what next?:
$ sudo pip install ISReader
This command installs the ISReader module
Basic Usage
After getting the ISReader module, usage is really simple:
from ISReader.Reader import Reader # create Reader instance reader = Reader(access_key="YOUR_ACCESS_KEY", bucket_key="YOUR_BUCKET_KEY") # get latest events for all stream keys all_latest_events = reader.get_latest() # get latest events for specific stream keys signal_keys = ['signal_a', 'signal_b'] events = reader.get_latest(keys=signal_keys)