Skip to main content

A Python library for generating synthetic time series data

Project description

Synthetic Time Series Data Generator

Python CI

A Python library for generating synthetic time series data

Special thanks to: Nike-Inc repo

MarineGEO circle logo

Installation

PyPi (recommended)

You can install with pip directly by

pip install ts-data-generator

Repo

After cloning this repo and creating a virtual environment, run the following command:

pip install --editable .

Usage

  1. To check out constructing for time series data, check the sample notebook here
  2. To extract the trends from an existing data, check this sample notebook here

CLI

You can also use the command line utility tsdata to generate the data.

(venv) ~/ts-data-generator   cli $ tsdata generate --help
Usage: tsdata generate [OPTIONS]

  Generate time series data and save it to a CSV file.

Options:
  --start TEXT                    Start datetime 'YYYY-MM-DD'  [required]
  --end TEXT                      End datetime 'YYYY-MM-DD'  [required]
  --granularity [FIVE_MIN|HOURLY|DAILY]
                                  Granularity of the time series data  [required]
  --dims TEXT                     + separated list of dimensions definition of format 'name:function:values'  [required]
  --mets TEXT                     + separated list of metrics definition trends of format 'name:trend(*params)'  [required]
  --output TEXT                   Output file name  [required]
  --help                          Show this message and exit.

For example you can call this cli tool like below to generate data

tsdata generate \
  --start "2019-01-01" \
  --end "2019-01-12" \
  --granularity "FIVE_MIN" \
  --dims "product:random_choice:A,B,C,D" \
  --dims "product_id:random_float:1,4" \
  --dims "const:constant:5" \
  --mets "sales:LinearTrend(limit=500)+WeekendTrend(weekend_effect=50)" \
  --mets "trend:LinearTrend(limit=10)" \
  --output "data.csv"

Release method

  1. git tag <x.x.x>
  2. git push origin <x.x.x>

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.1.2.tar.gz (814.9 kB 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.1.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ts_data_generator-0.1.2.tar.gz
  • Upload date:
  • Size: 814.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ts_data_generator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bf298e43925e441bddd59d342c988f6be3ed50b2b6ebee53772cc37ca5d9330f
MD5 3060de9a73c0b832be84e6a9e13b12a8
BLAKE2b-256 86d0f4964ca0ec55e19132e3af8181464c6e5c4d41b4b11edaea4858cfb156c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ts_data_generator-0.1.2.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.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ts_data_generator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1706883ac130a4004a7f12ca1fdf03a1c05dd1a1c7abeaee01a8a8646aaf4ef5
MD5 d59a985b054cff43d06d3fa6c3bfcdcf
BLAKE2b-256 ac238a013e8cca976c360c3011b0f491f830338c2d6920a2f03122f4fc0e429d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ts_data_generator-0.1.2-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