Skip to main content
ts-data-generator logo

Synthetic Time Series Data Generator

CI Python License

Generate realistic synthetic time series datasets with configurable dimensions, metrics, composable trend functions, and injectable anomalies — via a Python API or the tsdata CLI or online

sample plot

📚 Documentation

For complete details on features, API reference, CLI usage, and advanced configuration, visit our documentation site:

👉 https://manojmanivannan.github.io/ts-data-generator/


Features

  • Realistic Data: Mimic real-world time series with trends, seasonality, and noise.
  • Composable Trends: Layer multiple functions (Sinusoidal, Linear, AR Noise, Markov) to create complex signals.
  • Multivariate Dimension Expansion: Expand dimensions to their full Cartesian product (expand_dimensions) with independent, reproducible per-combination metric series and per-dimension control.
  • Correlated Multi-Items: Generate linked dimension tuples and correlated metric groups simultaneously (add_multi_items).
  • Injectable Anomalies: Simulate failures with point anomalies, missing data gaps, and concept drifts.
  • Deterministic: Guaranteed reproducibility via a seedable RNG.
  • CLI & API: Use the tsdata CLI for rapid prototyping or the Python API for production pipelines.
  • Schema Imputing: Reverse-engineer generation configs from existing CSV datasets.

Quickstart

Installation

pip install ts-data-generator

No install needed? Run the CLI directly with uv:

uvx --from ts-data-generator tsdata --help

Use --from (not --with) because the package name (ts-data-generator) differs from the executable name (tsdata).

CLI Usage

tsdata generate --start 2024-01-01 --end 2024-01-07 --granularity h \
    --dims "region:US,EU,AP" \
    --mets "sales:LinearTrend(slope=45)+SinusoidalTrend(amplitude=10,freq=24)" \
    --output sales.csv

# Multivariate expansion with explicit scaling and stochastic variance
tsdata generate --start 2024-01-01 --end 2024-01-07 --granularity h \
    --dims "region=random_choice(US,EU),weights={US:5,EU:2}" \
    --dims "env=random_choice(prod,dev)" \
    --mets "sales:LinearTrend(slope=45)+SinusoidalTrend(amplitude=10,freq=24)" \
    --expand-dimensions \
    --scale-variance 0.2 \
    --output expanded_sales.csv

Python API

from ts_data_generator import DataGen
from ts_data_generator.utils.functions import random_choice
from ts_data_generator.utils.trends import SinusoidalTrend, LinearTrend

# Expand dimensions across Cartesian product with scaled multi-series metrics
dg = DataGen(
    start_datetime="2024-01-01",
    end_datetime="2024-01-07",
    granularity="h",
    seed=42,
    expand_dimensions=True,
    scale_variance=0.2,
)

# Explicit dimension weights scale metrics differently per category slice
dg.add_dimension("tier", {"enterprise": 10.0, "pro": 3.0, "free": 1.0})
dg.add_dimension("region", random_choice(["US", "EU"]), weights={"US": 5.0, "EU": 2.0})
dg.add_dimension("environment", random_choice(["prod", "dev"]))
dg.add_metric("sales", {LinearTrend(offset=100, slope=10), SinusoidalTrend(amplitude=20, freq=24)})

# Linked correlated columns with tuple weights
dg.add_multi_items(
    names=["city", "country"],
    function=[("New York", "US"), ("London", "UK")],
    weights={("New York", "US"): 4.0, ("London", "UK"): 2.0},
)

df = dg.data
print(f"Generated {len(df)} rows across {df.groupby(['tier', 'region', 'environment', 'city']).ngroups} combinations")
dg.plot()

License

MIT — see LICENSE.

Metadata

Release files for ts-data-generator 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ts-data-generator 0.8.0
File Size Uploaded Provenance Actions
ts_data_generator-0.8.0.tar.gz 1.7 MB With provenance Details for ts_data_generator-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ts-data-generator 0.8.0
File Interpreter ABI Platform Actions
ts_data_generator-0.8.0-py3-none-any.whl Python 3 none any Details for ts_data_generator-0.8.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / ts_data_generator-0.8.0.tar.gz

Download URL ts_data_generator-0.8.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
13cb925b12fcc371e3065d69b2064d2fcd07cb5c4bfea749f1aa220039755518
BLAKE2b-256 checksum
How to use checksums
7c9edeb71cffb87a168f10ddfda090823d3adbf22363e83e247e33b17975e875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / ts_data_generator-0.8.0-py3-none-any.whl

Download URL ts_data_generator-0.8.0-py3-none-any.whl
Size 77.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ae0ae683afac1af1d594370da15aef686d9993475a0f8fa2754b2af311f4c0e
BLAKE2b-256 checksum
How to use checksums
0d5b5ce3f8f71266a5f87da883a0d809014ca763141d9827e9bc77d739453cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for ts-data-generator 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ts_data_generator-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page