Metadata-Version: 2.4
Name: ts-data-generator
Version: 0.5.2
Summary: A Python library for generating synthetic time series data
Project-URL: Repository, https://github.com/manojmanivannan/ts-data-generator.git
Project-URL: Issues, https://github.com/manojmanivannan/ts-data-generator/issues
Author-email: Manoj Manivannan <manojm18@live.in>
License: MIT
License-File: LICENSE
Keywords: data engineering,data generator,python,synthetic data,time series
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Requires-Dist: click>=8.0
Requires-Dist: matplotlib>=3.5
Requires-Dist: pandas>=1.5
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dotenv>=1.0
Provides-Extra: all
Requires-Dist: holidays>=0.96; extra == 'all'
Requires-Dist: scipy>=1.7; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.3; extra == 'dev'
Provides-Extra: holidays
Requires-Dist: holidays>=0.96; extra == 'holidays'
Provides-Extra: imputer
Requires-Dist: scipy>=1.7; extra == 'imputer'
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == 'test'
Requires-Dist: ruff>=0.3; extra == 'test'
Description-Content-Type: text/markdown

<div align="center">

<img src="https://raw.githubusercontent.com/manojmanivannan/ts-data-generator/refs/heads/main/tsdata-logo.svg" alt="ts-data-generator logo" width="100"/>

# Synthetic Time Series Data Generator

[![CI](https://github.com/manojmanivannan/ts-data-generator/actions/workflows/ci.yaml/badge.svg)](https://github.com/manojmanivannan/ts-data-generator/actions/workflows/ci.yaml)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green)](./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.

<img src="https://github.com/manojmanivannan/ts-data-generator/raw/main/notebooks/image.png" alt="sample plot" width="800"/>

</div>

---

## 📚 Documentation

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

👉 **[https://manojmanivannan.github.io/ts-data-generator/](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

```bash
pip install ts-data-generator
```

### CLI Usage

```bash
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

```python
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](./LICENSE).
