Welcome to Xively Python’s documentation

xively-python is a wrapper around Xively’s REST API to make working with the connected object cloud easy and pythonic.

Example:

>>> import xively
>>> api = xively.XivelyAPIClient("YOUR_API_KEY")
>>> feed = api.feeds.get(7021)
>>> # Viewing datapoints
>>> import datetime
>>> start = datetime.datetime(2013, 1, 1, 14, 14, 55)
>>> stream = feed.datastreams[0]
>>> points = stream.datapoints.history(start=start, duration='1second')
>>> list(points)  
[xively.Datapoint(datetime.datetime(...), '0.25741970'), ...]
>>> # Uploading new points
>>> import random
>>> randompoints = [
...     xively.Datapoint(datetime.datetime.now(), random.random()),
...     xively.Datapoint(datetime.datetime.now(), random.random()),
...     xively.Datapoint(datetime.datetime.now(), random.random()),
... ]
>>> stream.datapoints = randompoints
>>> stream.update(fields='datapoints')

Contents:

Indices and tables

Table Of Contents

Next topic

API Reference

This Page