Name: btrdb-python
Owner: Software Defined Buildings
Description: Python bindings for BTrDB
Created: 2016-02-18 05:55:16.0
Updated: 2016-11-06 20:17:55.0
Pushed: 2016-11-06 20:17:54.0
Homepage: null
Size: 27
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
These BTrDB Bindings for Python are meant to be used with Python's multithreading library. Documentation can be generated using pydoc.
Here is an example:
import uuid
import btrdbcapnp
# This is the UUID of the stream we are going to interact with
u = uuid.UUID('6390e9df-dfcb-4084-8080-8c719ce751ed')
# Set up the BTrDB Connection and Context
connection = btrdbcapnp.BTrDBConnection('localhost', 4410)
context = connection.newContext()
# Insert some data
# We have to use the "sync" flag because we want the insert to be committed immediately, so that we can query it right away
statuscode = context.insertValues(u, ((1, 10), (3, 14), (5, 19), (9, 13)), sync = True)
print statuscode
# Query some data
result = context.queryStandardValues(u, 0, 7)
print result
, 10.0), (3, 14.0), (5, 19.0)], 2L)
# Close the context and connection
context.destroy()
connection.close()