Python SDK for the Novant API
Project description
novant-python
Python SDK for the Novant API.
Installation
pip install novant
Or install from source:
git clone https://github.com/novant-io/novant-python.git
cd novant-python
pip install -e .
Quick Start
from novant import NovantClient
client = NovantClient(api_key="ak_xxx")
# Get project info
proj = client.project()
print(proj.city) # "Richmond, VA"
print(proj.tz) # "New_York"
# List assets
for asset in client.assets():
print(asset.name, asset.type)
# Read current values
for v in client.values(source_id="s.2"):
print(v.id, v.val, v.status)
# Get trend data
for row in client.trends(point_ids=["s.2.4", "s.2.5"], date="2026-03-09"):
print(row.ts, row.values)
Pandas & NumPy
Install with optional pandas support:
pip install novant[pandas]
Convert values and trends directly to DataFrames:
# Values as DataFrame
result = client.values(source_id="s.2")
df = result.to_dataframe()
# Trends as DataFrame with DatetimeIndex
trends = client.trends(point_ids=["s.2.4", "s.2.5"], date="2026-03-09")
df = trends.to_dataframe()
# Trends as NumPy array
arr = trends.to_numpy()
API
Client
client = NovantClient(api_key="ak_xxx", timeout=30)
Client arguments:
| Parameter | Default | Description |
|---|---|---|
api_key |
— | API key string |
timeout |
30 |
Request timeout in seconds |
Methods
| Method | Returns | Description |
|---|---|---|
project() |
Project |
Get project metadata |
assets(asset_ids=None) |
AssetList |
List assets |
spaces(space_ids=None) |
SpaceList |
List spaces |
zones(zone_ids=None) |
ZoneList |
List zones |
sources(source_ids=None, bound_only=False) |
SourceList |
List sources |
points(source_id=None, asset_id=None, point_ids=None) |
PointList |
List points for a source or asset |
values(source_id=None, asset_id=None, point_ids=None) |
ValueList |
Get current values |
trends(point_ids, ...) |
TrendData |
Get historical trend data |
write(point_id, value, level=None) |
WriteResult |
Write a value to a point |
import_zones(csv_data) |
dict |
Import zones from CSV |
import_spaces(csv_data) |
dict |
Import spaces from CSV |
import_assets(csv_data) |
dict |
Import assets from CSV |
import_sources(csv_data) |
dict |
Import sources from CSV |
import_source_map(csv_data) |
dict |
Import source point mappings from CSV |
import_trends(csv_data, mode=None) |
dict |
Import trend data from CSV |
See the Novant API docs for full parameter details.
Error Handling
API errors raise NovantErr:
from novant import NovantClient, NovantErr
client = NovantClient(api_key="ak_xxx")
try:
client.project()
except NovantErr as e:
print(e.code) # HTTP status code
print(e.message) # Error message
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
novant-0.1.0.tar.gz
(9.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file novant-0.1.0.tar.gz.
File metadata
- Download URL: novant-0.1.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbef2e9a0bdf582c8aad3aecef6f73222baee3b12209965b72373fbfc8893c47
|
|
| MD5 |
b701ef9ce84a0af35bf4d5f2a6682d3e
|
|
| BLAKE2b-256 |
51f452fc0b771a1a21b782bec5f93fbd9d6334a9d85323d5a50bc129dbf956eb
|
File details
Details for the file novant-0.1.0-py3-none-any.whl.
File metadata
- Download URL: novant-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34c809a87c89acc114c93bf1dfe328920d27eca96f5ec0ce5396090a5fac6ddb
|
|
| MD5 |
b11375c69624b08a95e29b1b0bed0737
|
|
| BLAKE2b-256 |
5dbd9abee90dba478e74f7dbcbb27325fddaf105a3b3e5076d0c8cfcb4cd29a9
|