https://github.com/htm-community/riverpy
Python API client for River View
https://github.com/htm-community/riverpy
Last synced: 5 months ago
JSON representation
Python API client for River View
- Host: GitHub
- URL: https://github.com/htm-community/riverpy
- Owner: htm-community
- Created: 2015-10-17T13:49:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-27T18:52:23.000Z (over 10 years ago)
- Last Synced: 2025-09-25T01:02:04.575Z (10 months ago)
- Language: Python
- Size: 145 KB
- Stars: 1
- Watchers: 10
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`riverpy` is a python API client for [River View](https://github.com/nupic-community/river-view) instances.
## Installation
pip install riverpy
## Usage
```python
from datetime import datetime
from riverpy import RiverViewClient
# create client that connects by default to http://data.numenta.org
client = RiverViewClient()
# get River for http://data.numenta.org/portland-911/meta.html
river = client.river("portland-911")
# get Stream for http://data.numenta.org/portland-911/portland-911/data.html
stream = river.stream("portland-911")
# get first 500 data points, starting at 2015/05/01
cursor = stream.data(limit=500, since=datetime(2015, 4, 1))
# display some details about the data cursor
print cursor
# get data headers
headers = cursor.headers()
# get actual data
data = cursor.data()
# page through the data into the future until there's no more
while (cursor):
cursor = cursor.next()
print cursor
```
## Other Examples
See [`harness.py`](harness.py) for further examples of usage.