Welcome to btrdb docs!#

https://github.com/PingThingsIO/btrdb-python/actions/workflows/release.yaml/badge.svg https://readthedocs.org/projects/btrdb/badge/?version=latest https://img.shields.io/pypi/pyversions/btrdb.svg https://img.shields.io/badge/License-BSD%203--Clause-blue.svg https://img.shields.io/pypi/v/btrdb.svg

Welcome to btrdb-python’s documentation. We provide Python access to the Berkeley Tree Database (BTrBD) along with some select convenience methods. If you are familiar with other NoSQL libraries such as pymongo then you will likely feel right at home using this library.

BTrDB is a very, very fast timeseries database. Specifically, it is a time partitioned, version annotated, clustered solution for high density univariate data. It’s also incredibly easy to use. Checkout out our Installing page to get setup and then visit Quick Start for a brief tour. Some sample code is below to whet your appetite.

import btrdb
from btrdb.utils.timez import to_nanoseconds

# establish connection to a server
conn = btrdb.connect("192.168.1.101:4410")

# search for streams and view metadata
streams = conn.streams_in_collection("USEAST_NOC1/90807")
for stream in streams:
    print(stream.collection, stream.name, stream.tags())

# retrieve a single stream
stream = conn.stream_from_uuid("07d28a44-4991-492d-b9c5-2d8cec5aa6d4")

# print one hour of time series data starting at 1/1/2018 12:30:00 UTC
start = to_nanoseconds(datetime(2018,1,1,12,30))
end = start + (60 * 60 * 1e9)
for point, _ in stream.values(start, end):
    print(point.time, point.value)

# return the data as an arrow table instead
data = stream.arrow_values(start, end)

User Guide#

The remaining documentation can be found below. If there is anything you’d like added or corrected, please feel free to submit a pull request or open an issue in Github!

Indices and tables#