BTrDB Bindings for Python
=========================
These are BTrDB Bindings for Python meant to be used with Python's multithreading library. Documentation can be generated using pydoc and viewed from **btrdb4.html** file.

Example of usage:
```python

>>> # This works for both Python 2 and Python 3
...
>>> import btrdb4
>>> import time
>>> import uuid
>>>
>>> # This is the UUID of the stream we are going to interact with
... uu = uuid.uuid4()
>>> uu
UUID('a5fba242-74c8-4e59-ad89-c1565ee3229c')
>>>
>>> # Connect to BTrDB and obtain a BTrDB handle
... conn = btrdb4.Connection("my.server:4410")
>>> b = conn.newContext()
>>>
>>> # Connect using environment variables $BTRDB_ENDPOINTS and $BTRDB_API_KEY
>>> # Note that this returns a context directly rather than a connection.
>>> b = btrdb4.connect()
>>>
>>> # Obtain a stream handle
... s = b.streamFromUUID(uu)
>>> s.exists()
False
>>>
>>> # Create the stream
... s = b.create(uu, "a/b/c", {"created_by": b"me", "time_created": bytes(str(time.time()).encode("utf-8"))})
>>> s.exists()
True
>>>
>>> # Insert some data
... version = s.insert(((1, 10), (3, 14), (5, 19), (9, 13)))
>>> version
0
>>> # Flush the stream
... s.flush()
>>>
>>> # Query most recent version of some data
... for rawpoint, version in s.rawValues(0, 7):
...     print("{0}: {1}".format(rawpoint, version))
...
>>>
>>> # Query statistical values in aligned windows for most recent flushed version
... for spoint in s.alignedWindows(0,1024,10,s.version()):
...     print(str(spoint))
... 
>>> # Query statistical values in unaligned windows for version 13
... for spoint in s.windows(0,10,2,0,13L):
...     print(str(spoint))
... 

```
