time series quality library
Project description
📊 Time Series Quality (TSQ) Data Card Generator
A Python tool to automatically generate data cards (JSON, HTML, LaTeX) from tidy time-series data in the shape: [timestamp, entity, variable, value]
The data card summarizes dataset characteristics, data quality, and per-variable/per-entity statistics.
Useful for finance, environmental, health, energy, or any temporal datasets.
✨ Features
- Dataset overview (observations, entities, variables, time range, inferred frequency).
- Data quality checks (missing values, duplicates, timestamp monotonicity).
- Variable-level stats (obs, missing, min, max).
- Entity-level breakdown with variable stats.
- Export to:
- JSON (machine-readable)
- HTML (human-readable data card)
- LaTeX (academic reporting)
📦 Installation
Install directly from PyPI:
pip install tsq-lib
🚀 Usage
import pandas as pd
from tsq.data_card import save_data_card_json, save_data_card_html, save_data_card_latex
# Example dataset in tidy format
data = {
"timestamp": pd.date_range("2025-01-01", periods=5, freq="D").repeat(2),
"entity": ["AAPL"]*5 + ["MSFT"]*5,
"variable": ["close"]*10,
"value": [170, 171, 169, 172, None, 310, 312, 309, 315, 318]
}
df = pd.DataFrame(data)
# Generate JSON, HTML, and LaTeX data cards
save_data_card_json(df, "Example Equity Dataset", "data_card.json")
save_data_card_html(df, "Example Equity Dataset", "data_card.html")
save_data_card_latex(df, "Example Equity Dataset", "data_card.tex")
print("✅ Data card reports saved.")
📂 Outputs
- data_card.json → machine-readable stats
- data_card.html → clean, human-readable data card
- data_card.tex → LaTeX table & section for papers
📖 Examples
This package can be applied across domains. Two example workflows are included:
-
Finance Example
Demonstrates generating a data card for equity price data (e.g. AAPL, MSFT close prices).
See:examples/finance -
Air Quality Example
Demonstrates transforming the UCI Air Quality dataset into tidy format and generating a data card with per-variable statistics.
See:examples/air_quality
Acknowledgments
Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Research Executive Agency (REA). Neither the European Union nor the granting authority can be held responsible for them.
License
MIT — see LICENSE.
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 tsq_lib-0.2.1.tar.gz.
File metadata
- Download URL: tsq_lib-0.2.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a87fdaac0c4e3fde41009050b0d1ef86c6fed45d82a2d20de62f5e8d58c0e650
|
|
| MD5 |
a3b031ebed62673bb01742e879a27478
|
|
| BLAKE2b-256 |
50daaa7e9a127818a4b7b44e77c1058d82ecc29fe37fb992a6abbfa43516091b
|
Provenance
The following attestation bundles were made for tsq_lib-0.2.1.tar.gz:
Publisher:
pypi-publish.yml on MSCA-DN-Digital-Finance/tsq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsq_lib-0.2.1.tar.gz -
Subject digest:
a87fdaac0c4e3fde41009050b0d1ef86c6fed45d82a2d20de62f5e8d58c0e650 - Sigstore transparency entry: 473238427
- Sigstore integration time:
-
Permalink:
MSCA-DN-Digital-Finance/tsq@f38b0c5a002e2d77e9c7439287ad417838d8e591 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/MSCA-DN-Digital-Finance
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@f38b0c5a002e2d77e9c7439287ad417838d8e591 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tsq_lib-0.2.1-py3-none-any.whl.
File metadata
- Download URL: tsq_lib-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.2 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 |
dbbf4d15a4a5e7a6fe42f459091ce6209782b3b59449447f85ce995446e25c52
|
|
| MD5 |
db5bd59733f475b2c428e8c15052bece
|
|
| BLAKE2b-256 |
055ced4a6787124ba7625ff0fc51b573a5aa2b6e1286a33b26604bb53af72e50
|
Provenance
The following attestation bundles were made for tsq_lib-0.2.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on MSCA-DN-Digital-Finance/tsq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsq_lib-0.2.1-py3-none-any.whl -
Subject digest:
dbbf4d15a4a5e7a6fe42f459091ce6209782b3b59449447f85ce995446e25c52 - Sigstore transparency entry: 473238444
- Sigstore integration time:
-
Permalink:
MSCA-DN-Digital-Finance/tsq@f38b0c5a002e2d77e9c7439287ad417838d8e591 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/MSCA-DN-Digital-Finance
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@f38b0c5a002e2d77e9c7439287ad417838d8e591 -
Trigger Event:
release
-
Statement type: