Shared time-series domain layer and Plotly renderer for air-Q MCP providers
Project description
airq-mcp-timeseries
Shared time-series domain layer and Plotly renderer for air-Q MCP providers.
This project is not an MCP server. It is the shared package that consolidates
time-series querying, normalization, resampling, summarization and plotting so
that mcp-airq and mcp-airq-cloud can reuse the same business logic.
Features
- shared query, series, summary and plotting data models
- source-agnostic
TimeSeriesProviderprotocol - metric normalization and query validation
- resampling and peak-preserving downsampling
- renderer-independent plot model
- Plotly rendering for HTML plus matplotlib-based PNG, SVG and WebP exports
- CSV and Excel export for processed time-series data
- async high-level orchestration with
plot_history(),summarize_history()andexport_history()
Installation
pip install airq-mcp-timeseries
This package now includes Pillow as a runtime dependency so WebP rendering
works out of the box.
For development:
uv sync --frozen --extra dev
uv run pre-commit install
Usage
from datetime import datetime, timedelta
from airq_mcp_timeseries import HistoryQuery, PlotRequest, Selector, export_history, plot_history
request = PlotRequest(
selector=Selector(devices=["Living Room"]),
metric="co2",
start=datetime.now().astimezone() - timedelta(hours=6),
end=datetime.now().astimezone(),
)
result = await plot_history(provider, request)
export = await export_history(
provider,
HistoryQuery(
selector=request.selector,
metric=request.metric,
start=request.start,
end=request.end,
),
output_format="csv",
)
provider must implement the shared TimeSeriesProvider protocol.
Development
Run the full local validation stack:
uv run pre-commit run --all-files
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest --exitfirst -n auto
Release Process
- Update
versioninpyproject.toml. - Commit the change and create a matching Git tag such as
v0.1.2. - Publish a GitHub Release from that tag.
The publish workflow validates that the release tag matches
pyproject.toml, builds the package and publishes it to PyPI.
License
Apache License 2.0. See LICENSE.
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
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 airq_mcp_timeseries-0.1.5.tar.gz.
File metadata
- Download URL: airq_mcp_timeseries-0.1.5.tar.gz
- Upload date:
- Size: 97.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c092d2313f88d3acf2d969bd73c373cf3aeb83774f04b08942a6531ae7305487
|
|
| MD5 |
0e0fb83be5f495a3dc348dc2e7329999
|
|
| BLAKE2b-256 |
74e00b57929ec1161738ea7c8f55cc87094e6c32c684b0b4f28411e2f8d87a3e
|
Provenance
The following attestation bundles were made for airq_mcp_timeseries-0.1.5.tar.gz:
Publisher:
publish.yml on CorantGmbH/airq-mcp-timeseries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airq_mcp_timeseries-0.1.5.tar.gz -
Subject digest:
c092d2313f88d3acf2d969bd73c373cf3aeb83774f04b08942a6531ae7305487 - Sigstore transparency entry: 1109964734
- Sigstore integration time:
-
Permalink:
CorantGmbH/airq-mcp-timeseries@dc9bc5fe60dad25b11154190b9418383827b00ac -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/CorantGmbH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc9bc5fe60dad25b11154190b9418383827b00ac -
Trigger Event:
release
-
Statement type:
File details
Details for the file airq_mcp_timeseries-0.1.5-py3-none-any.whl.
File metadata
- Download URL: airq_mcp_timeseries-0.1.5-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18432649e13a65f1d807cf4c4744cd9c31d9c3ee8c9fbe53effcfb354c65c4cb
|
|
| MD5 |
611d4c19a3d4fe61089f36b1c618455c
|
|
| BLAKE2b-256 |
bb604f20394a7de173723176dbf98ef0bbfae3086f095731451fb1fb84f47263
|
Provenance
The following attestation bundles were made for airq_mcp_timeseries-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on CorantGmbH/airq-mcp-timeseries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airq_mcp_timeseries-0.1.5-py3-none-any.whl -
Subject digest:
18432649e13a65f1d807cf4c4744cd9c31d9c3ee8c9fbe53effcfb354c65c4cb - Sigstore transparency entry: 1109964758
- Sigstore integration time:
-
Permalink:
CorantGmbH/airq-mcp-timeseries@dc9bc5fe60dad25b11154190b9418383827b00ac -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/CorantGmbH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dc9bc5fe60dad25b11154190b9418383827b00ac -
Trigger Event:
release
-
Statement type: