Skip to content

initialstate/python_reader

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Python Data Reader

repo linter workflow

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
sudo yum install curl

Using Package Management

The package is hosted in PyPI under the package name ISReader.

If you don't have pip:

  1. (optional) Check if you have python setup tools installed:

    $ easy_install --version
    

    if you don't see a version number come back, you should install setuptools:

    $ sudo apt-get install python-setuptools
    
  2. (optional) Check if you have pip installed:

    $ pip --version
    

    if you don't see a version number after running the above command, install pip using easy_install:

    $ sudo easy_install pip
    

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)

About

Python module for streaming to Initial State

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published