Onboard Python SDK

Click Here for GitHub. This package provides Python bindings to our building data API. For more details, you can consult the API's Swagger documentation.

API Access

You'll need an API key or existing account in order to use this client. If you don't have one and would like to start prototyping against an example building please request a key.

Once you have a key, data access is explicitly granted by attaching one or more 'scopes' to the key. Our endpoints are grouped by scope on the Swagger documentation viewer.

Real Example: Client Measuring CO2

First, you'll need to install the client (requires Python equal or greater than version 3.7 )

$ pip install onboard.client
Now you can use the client to fetch timeseries data for sensors by building or based on type.
This example requires a key with the scopes auth , general and buildings:read .
from onboard.client import OnboardClient
client = OnboardClient(api_key='your-key-here')

client.whoami()  # verify access & connectivity

client.get_all_point_types()  # retrieve available types of sensors

# retrieve the past 6 hours of data for sensors measuring CO2 ppm
from datetime import datetime, timezone, timedelta
from onboard.client.models import PointSelector, TimeseriesQuery, PointData
from typing import List

query = PointSelector()
query.point_types = ['Zone Carbon Dioxide']
query.buildings = ['Example Building']
selection = client.select_points(query)
end = datetime.utcnow().replace(tzinfo=timezone.utc)
start = end - timedelta(hours=6)

timeseries_query = TimeseriesQuery(point_ids=selection['points'], start=start, end=end)  # Or `TimeseriesQuery(selector=query, ...)`

sensor_metadata = client.get_points_by_ids(selection['points'])
sensor_data: List[PointData] = list(client.stream_point_timeseries(timeseries_query))