Metadata-Version: 2.4
Name: intellistream-datahub-sdk
Version: 0.2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
License-File: LICENSE
License-File: NOTICE
Summary: Python bindings for the IntelliStream DataHub SDK: time series and datapoints, events, resources and relationship edges, files, datasets, labels and subscriptions.
Author-email: IntelliStream AS <support@intellistream.ai>
License-Expression: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Issues, https://github.com/IntelliStream-DataHub/dataplatform-rust-sdk/issues
Project-URL: Repository, https://github.com/IntelliStream-DataHub/dataplatform-rust-sdk

# intellistream-datahub-sdk

Python bindings for the IntelliStream DataHub SDK — a client for the DataHub REST API, implemented
in Rust and exposed to Python with [PyO3](https://pyo3.rs).

```bash
pip install intellistream-datahub-sdk
```

```python
from datetime import datetime, timezone

import intellistream_datahub_sdk as dh

client = dh.DataHubClient.from_envfile(".env")

# Create a time series, then ingest a datapoint into it.
client.timeseries.create([dh.TimeSeries(external_id="sensor_1", name="Sensor 1")])
client.timeseries.insert_from_lists(
    timestamps=[datetime.now(timezone.utc)],
    values=[21.5],
    ts="sensor_1",
)

# Find the alarms.
alarms = client.events.filter(
    dh.EventFilterForm(filter=dh.EventFilter(type="ALARM"), limit=100)
)
```

Both a synchronous and an asynchronous client are available — `DataHubClient` and
`AsyncDataHubClient`. The async one exposes the same services with awaitable methods.

Anywhere an entity is identified you may pass its external id, its numeric id, an `IdCollection`,
or the entity itself.

## What it covers

| Service | Highlights |
|---|---|
| `timeseries` | time-series CRUD, datapoint ingestion and retrieval |
| `events` | event CRUD, filter/search, and the type/sub-type/status/source vocabularies |
| `resources` | hierarchical assets, plus relationship `edges` between them |
| `files` | upload, download, directory listing, move/rename, trash and restore |
| `datasets` | dataset CRUD and search |
| `labels` | label CRUD |
| `subscriptions` | subscription CRUD and WebSocket listening |
| `functions` | function registration and lookup |
| `units` | unit lookup |

## Configuration

The client reads its configuration from a `.env` file or the environment:

- `BASE_URL` — the backend root, e.g. `https://datahub.example.com`
- either `TOKEN` — a bearer token used as-is
- or `CLIENT_ID`, `CLIENT_SECRET` and `TOKEN_URI` — an OAuth2 client-credentials exchange

## Type hints

The package ships `py.typed` and a full `.pyi` stub, so mypy and IDE completion work out of the box.

## License

Apache License 2.0 — see [LICENSE](LICENSE).

Source: <https://github.com/IntelliStream-DataHub/dataplatform-rust-sdk>

