Store time series data as HDF5 files and access them through an API.
Project description
aitana-storage
Store time series feature data as NetCDF or Zarr archives, organised in a directory hierarchy, and access them through a FastAPI service.
Installation
pip install aitana-storage
to_pytorch() requires PyTorch, which is an optional dependency:
pip install aitana-storage[pytorch]
Usage
Saving and querying features
Storage organises features in a directory tree (e.g. site/sensor/channel)
and stores each feature as a NetCDF or Zarr archive on disk.
from datetime import datetime
from aitana.storage import Storage, generate_test_data
g = Storage('Whakaari', '/tmp', backend='zarr')
c = g.get_substore('WIZ', '00', 'HHZ')
c.save(generate_test_data(dim=1))
g.starttime = datetime(2012, 1, 1)
g.endtime = datetime(2012, 1, 2, 23, 59, 59)
rsam = c('rsam') # -> xarray.DataArray indexed by datetime
PyTorch dataset
from torch.utils.data import DataLoader
dataset = g.to_pytorch(['rsam', 'dsar'])
dataloader = DataLoader(dataset, batch_size=32, shuffle=True)
FastAPI service
aitana.storage.api.TonikAPI exposes /feature, /inventory and /labels
endpoints over HTTP.
tonik_api --rootdir /data --port 8003
Grafana annotations
Post labels stored alongside features as Grafana annotations, or retrieve existing annotations from the Grafana API.
grafana_annotations http://<user>:<pwd>@<grafana-host>:<port> --labels labels.json
License
See the repository root for license information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 aitana_storage-0.1.1.tar.gz.
File metadata
- Download URL: aitana_storage-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08ad38c5a00842078435002b33ffb06e21809f2a9c95d6509c05e2a2a4360faa
|
|
| MD5 |
d91aec16e00f81f804bd81aefc8c6fe2
|
|
| BLAKE2b-256 |
c4bae33ef66b3d8183bc124a55cac0fc33300df5800de77fae5f0b85c2080922
|
File details
Details for the file aitana_storage-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aitana_storage-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee1a7cdd442f3548fe9515c58461e0510f906ee8b520d6d013e76dacb87f7f3
|
|
| MD5 |
439d64a3a281a00f173dcf70a970b150
|
|
| BLAKE2b-256 |
de1ce1198cb0b5027d6c0389317253e1141eac0536204db05e77a435a3c97b69
|