Skip to main content

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.

EU Logo

License

MIT — 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

tsq_lib-0.2.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsq_lib-0.2.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for tsq_lib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a87fdaac0c4e3fde41009050b0d1ef86c6fed45d82a2d20de62f5e8d58c0e650
MD5 a3b031ebed62673bb01742e879a27478
BLAKE2b-256 50daaa7e9a127818a4b7b44e77c1058d82ecc29fe37fb992a6abbfa43516091b

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tsq_lib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbbf4d15a4a5e7a6fe42f459091ce6209782b3b59449447f85ce995446e25c52
MD5 db5bd59733f475b2c428e8c15052bece
BLAKE2b-256 055ced4a6787124ba7625ff0fc51b573a5aa2b6e1286a33b26604bb53af72e50

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page