Skip to main content

A Python library for generating synthetic time series data

Project description

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.
  • 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

Python API

from ts_data_generator import DataGen
from ts_data_generator.utils.trends import SinusoidalTrend

dg = DataGen(seed=42)
dg.start_datetime = "2024-01-01"
dg.end_datetime = "2024-01-07"
dg.to_granularity("h")

dg.add_metric("temp", {SinusoidalTrend(amplitude=10, freq=24)})

df = dg.data
dg.plot()

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

ts_data_generator-0.6.3.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

ts_data_generator-0.6.3-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file ts_data_generator-0.6.3.tar.gz.

File metadata

  • Download URL: ts_data_generator-0.6.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ts_data_generator-0.6.3.tar.gz
Algorithm Hash digest
SHA256 8a2a2d4a58f356b10ec0ac01f2fb83750ffb9f1f933499aeccf269570cf54817
MD5 a3ed95dd77c7292c69270547fcb0c6bf
BLAKE2b-256 f523830a0bd10c3dbd7300a6ae6814014779f00a3e4c3e7b4cb3038dd83c3a5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ts_data_generator-0.6.3.tar.gz:

Publisher: ci.yaml on manojmanivannan/ts-data-generator

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

File details

Details for the file ts_data_generator-0.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ts_data_generator-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 58cc79c12beda301e470adbc9bc2bd26c282ae6a5ef9875d5e824f36ea3d0cdd
MD5 8f9279e5678d9923c93fcf11531293e9
BLAKE2b-256 a1fb5f089ab2a22f1db7d02828a3b475e77fa66da4e51024254294abd4514a18

See more details on using hashes here.

Provenance

The following attestation bundles were made for ts_data_generator-0.6.3-py3-none-any.whl:

Publisher: ci.yaml on manojmanivannan/ts-data-generator

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