Skip to main content

A DARTS-first CLI for time series analysis, preprocessing, and forecasting

Project description

tscli

tscli is a command-line tool for time series analysis and forecasting built around DARTS.

It is designed for a simple workflow:

  • load a CSV
  • clean common formatting issues
  • inspect and analyze the series
  • compare models on a holdout window
  • generate and export forecasts

tscli demo

What It Does

  • works directly from CSV files
  • detects and fixes common time-series formatting issues
  • supports a clean date + target workflow
  • benchmarks multiple models with MAE, RMSE, and MAPE
  • exports cleaned datasets, forecasts, benchmark tables, and plots
  • provides an interactive terminal mode

Install

Main install:

pip install tscli-darts

Local development install:

pip install -e .

Optional extras:

  • Classical DARTS models such as theta and exponential-smoothing
pip install -e .[classical]
  • AutoARIMA support
pip install -e .[autoarima]
  • Everything
pip install -e .[full]

Typical Workflow

1. Inspect the raw CSV

Use this first to confirm the time column, target column, inferred frequency, and any preprocessing fixes.

python -m tscli inspect .\sales.csv --time-col Month --target-col Sales

2. Clean the dataset

If the CSV has shorthand dates, duplicate timestamps, formatted numeric values, or other simple issues, save a normalized version.

python -m tscli clean .\sales.csv --time-col Month --target-col Sales --output .\cleaned_sales.csv

3. Analyze the time series

Get quick descriptive statistics and recent observations before forecasting.

python -m tscli analyze .\cleaned_sales.csv --time-col Month --target-col Sales

4. Benchmark models

Run several models against a holdout window, compare metrics, and optionally export the score table, forecast, and plot.

python -m tscli benchmark .\cleaned_sales.csv --time-col Month --target-col Sales --horizon 12 --models all --scores-output .\scores.csv --forecast-output .\best_forecast.csv --plot-output .\benchmark.png

5. Generate a forecast

Forecast future periods with a chosen model and optionally export the forecast and chart.

python -m tscli forecast .\cleaned_sales.csv --time-col Month --target-col Sales --model naive-drift --horizon 12 --output .\forecast.csv --plot-output .\forecast.png

6. Use interactive mode

Run the full workflow from a menu-driven terminal interface.

python -m tscli interactive .\cleaned_sales.csv --time-col Month --target-col Sales

Commands

  • inspect: summarize the dataset and show preprocessing fixes
  • clean: normalize and save a cleaned CSV
  • analyze: print descriptive statistics and recent observations
  • forecast: generate future values from one model
  • benchmark: compare several models on a holdout window
  • models: list supported forecasting models
  • interactive: launch the terminal menu workflow

Forecasting Models

Supported models:

  • naive-last
  • naive-drift
  • naive-seasonal
  • moving-average
  • weighted-moving-average
  • exp-smoothing
  • seasonal-average
  • seasonal-median
  • linear-trend
  • quadratic-trend
  • arima
  • sarima
  • theta
  • exponential-smoothing
  • auto-arima

Example Dataset

The bundled examples/sales.csv shows a shorthand monthly sales format like:

Month,Sales
1-01,266.0
1-02,145.9
1-03,183.1

tscli will detect and normalize that Month column into proper first-of-month datetimes.

Notes

  • The CSV should include a target column and optionally a time column.
  • If no time column is provided, tscli builds a synthetic integer index.
  • If DARTS cannot infer a frequency automatically, forecasting still uses the ordered observations.
  • Some classical DARTS models depend on optional libraries; when unavailable, forecast explains the missing requirement and benchmark skips the model.
  • arima and sarima remain DARTS-first models, with fallback behavior only when the DARTS classical path is unavailable.

Packaging

To build distributable artifacts locally:

python -m pip install build
python -m build

This will generate source and wheel distributions in dist/.

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

tscli_darts-0.1.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

tscli_darts-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file tscli_darts-0.1.1.tar.gz.

File metadata

  • Download URL: tscli_darts-0.1.1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tscli_darts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3c9ea2aec3ff1f9117820703a76d291f0402eceb3a4e284ca6a47ee01dd8d497
MD5 82a01fc040f7a1cac5340299caea008d
BLAKE2b-256 03cc214bbc0aac2d44386515275fd9b7aac578d3bec42f120a1220b8b03e30dc

See more details on using hashes here.

File details

Details for the file tscli_darts-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tscli_darts-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tscli_darts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae486ea0a40ba9e2bfdb874d15c690810823217ac4ee4660e7e899dd621dd0ae
MD5 751433759b26bd2cfb83231ae113d1f8
BLAKE2b-256 b54e47525f232fcc90fbbbe9cce99a5717c7dd2345c4b71506a941c9fa8f9857

See more details on using hashes here.

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