Skip to main content

Designed to make time series forecasting workflows faster, safer, and more standardized.

Project description

TSTools

TSTools is a Python package for making time series forecasting workflows faster, safer, and more standardized.

It is intended to become a practical forecasting helper package for:

  • validating forecasting datasets
  • exploring time series structure quickly
  • supporting reusable forecasting workflows

Today, the implemented package starts with the first and most important layer of that vision: data sanity checks for forecast readiness.

In the current version, sanity_checks(...) is designed for prepared forecasting data held in a pandas DataFrame.

Why TSTools

Forecasting projects often lose time because basic data problems are discovered too late:

  • invalid or inconsistent dates
  • duplicate time keys
  • missing timestamps
  • invalid target values
  • weak or broken grouped-series structure
  • messy regressor columns

TSTools is designed to catch those problems early, with an API that works well in notebooks, scripts, and pipeline-style checks.

Current Release

The current public workflow is centered on:

  • load_sample_data(...)
  • sanity_checks(...)

Current implemented package areas:

  • tstools.sanity forecast-readiness validation
  • tstools.datasets sample data for trying the API quickly

Planned package areas:

  • tstools.eda fast exploration and diagnostics for time series data
  • tstools.forecasting reusable forecasting helpers, baselines, and evaluation utilities

Install

Install from PyPI:

pip install tstools-forecast

Import it as:

import tstools

For local development:

pip install tstools-forecast

For editable local development:

pip install -e .

For development tools:

pip install -e .[dev]

Quickstart

from tstools import load_sample_data, sanity_checks

df = load_sample_data("sample_timeseries_dataframe")

report = sanity_checks(
    df,
    date_col="date",  # timestamp column for the time series
    target_col="sales",  # value column to validate for forecasting
    group_cols=["dfu"],  # key column(s) defining each individual series
    expected_freq="D",  # expected cadence, here daily
    min_history=10,  # minimum observations expected per series
    non_negative_target=True,
    integer_like_target=True,
    regressors={
        "categorical": ["promo_type"],
        "numerical": ["price"],
        "boolean": ["is_promo"],
    },
)

print(report.overall_status)
print(report.summary)

Use sanity_checks(...) once your forecasting dataset is already assembled into a modeling-ready table:

  • one date column
  • one or more target columns
  • optional key columns for panel data
  • optional regressor columns you want validated as model inputs

Only pandas DataFrames are supported in this version.

Recommended first-time flow:

  1. install tstools-forecast
  2. import from tstools
  3. run load_sample_data("sample_timeseries_dataframe")
  4. inspect the printed report and report.summary

What The Current Sanity Module Covers

sanity_checks(...) currently covers:

  • required columns
  • duplicate column names
  • empty data / zero usable rows
  • null group keys
  • date parsing
  • monotonic timestamp order
  • duplicate keys and conflicting duplicate keys
  • missing dates and frequency consistency
  • numeric target validity
  • target domain constraints
  • missing targets
  • constant and all-zero series
  • short history
  • typed regressor validation for categorical, numerical, and boolean regressors

It is most useful after raw joins, filtering, and feature assembly are already done, and before EDA or modeling begins.

Sample Data

TSTools ships with one maintained public demo dataset:

  • sample_timeseries_dataframe

It is intentionally designed to exercise the current sanity-check surface in one dataframe, including:

  • invalid dates
  • missing dates
  • duplicate and conflicting duplicate keys
  • missing targets
  • constant and all-zero series
  • short history
  • target domain violations
  • invalid or missing regressors

Report Statuses

Overall report status:

  • READY
  • READY_WITH_WARNINGS
  • NOT_READY

Check status:

  • PASS
  • WARN
  • FAIL
  • INFO

Product Direction

The long-term goal is not just to validate data, but to support a fuller forecasting workflow:

  1. validate time series inputs
  2. explore and diagnose the data
  3. build repeatable forecasting utilities on top of clean inputs

Development

Run verification:

.\.venv\Scripts\python.exe -m pytest
.\.venv\Scripts\python.exe -m bandit -q -r src

Docs

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

tstools_forecast-1.0.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

tstools_forecast-1.0.1-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file tstools_forecast-1.0.1.tar.gz.

File metadata

  • Download URL: tstools_forecast-1.0.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tstools_forecast-1.0.1.tar.gz
Algorithm Hash digest
SHA256 02f5d1bee7e983566f099f5045052b1eb9d3ca7f03153e9532f4fa903b4eb2b4
MD5 a2cb1749d543a190c4739343c7a570b8
BLAKE2b-256 0d36915c8769a9ca824f813157a778b3d061d63cb70a55d9d147d12a4a8702c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tstools_forecast-1.0.1.tar.gz:

Publisher: publish-prod.yml on rudreshmishra16/TSTools

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

File details

Details for the file tstools_forecast-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tstools_forecast-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08d0c4637c7f6c53254a884a389eac83e0b20a568971b048c5bb0e70e47d744f
MD5 7b82eee21f779e4c9c02672a03ffab88
BLAKE2b-256 92ed992b446db15e2b8c2e1b346d66a5f3d7ae37850801e84ef423c73be61ad7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tstools_forecast-1.0.1-py3-none-any.whl:

Publisher: publish-prod.yml on rudreshmishra16/TSTools

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