ts-data-generator


Namets-data-generator JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryA Python library for generating synthetic time series data
upload_time2025-02-19 20:05:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords data generator python synthetic data time series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- html title in the middle -->
<div align="center">

# Synthetic Time Series Data Generator

[![Python](https://img.shields.io/pypi/v/ts-data-generator)](https://pypi.org/project/ts-data-generator) ![CI](https://github.com/manojmanivannan/ts-data-generator/actions/workflows/ci.yaml/badge.svg)

A Python library for generating synthetic time series data

<sup>Special thanks to: [Nike-Inc](https://github.com/Nike-Inc/timeseries-generator) repo

<img src="https://github.com/manojmanivannan/ts-data-generator/raw/main/notebooks/image.png" alt="MarineGEO circle logo" style="height: 1000px; width:800px;"/>

<!-- ![Tutorial][tutorial] -->

</div>

## Installation
### PyPi (recommended)
You can install with pip directly by
```bash
pip install ts-data-generator
```

### Repo
After cloning this repo and creating a virtual environment, run the following command:
```bash
pip install --editable .
```

## Usage
1. To check out constructing for time series data, check the sample notebook [here](https://github.com/manojmanivannan/ts-data-generator/blob/main/notebooks/sample.ipynb)
2. To extract the trends from an existing data, check this sample notebook [here](https://github.com/manojmanivannan/ts-data-generator/blob/main/notebooks/imputer.ipynb)

### CLI

You can also use the command line utility `tsdata` to generate the data.
```bash
(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
```bash
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>`

<!-- [tutorial]: /notebooks/test.gif -->
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ts-data-generator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "data generator, python, synthetic data, time series",
    "author": null,
    "author_email": "Manoj Manivannan <manojm18@live.in>",
    "download_url": "https://files.pythonhosted.org/packages/51/37/5ff7030059ec2889c4b0f5f02d939097aab10d634996c4d3a725fd9aac29/ts_data_generator-0.1.3.tar.gz",
    "platform": null,
    "description": "<!-- html title in the middle -->\n<div align=\"center\">\n\n# Synthetic Time Series Data Generator\n\n[![Python](https://img.shields.io/pypi/v/ts-data-generator)](https://pypi.org/project/ts-data-generator) ![CI](https://github.com/manojmanivannan/ts-data-generator/actions/workflows/ci.yaml/badge.svg)\n\nA Python library for generating synthetic time series data\n\n<sup>Special thanks to: [Nike-Inc](https://github.com/Nike-Inc/timeseries-generator) repo\n\n<img src=\"https://github.com/manojmanivannan/ts-data-generator/raw/main/notebooks/image.png\" alt=\"MarineGEO circle logo\" style=\"height: 1000px; width:800px;\"/>\n\n<!-- ![Tutorial][tutorial] -->\n\n</div>\n\n## Installation\n### PyPi (recommended)\nYou can install with pip directly by\n```bash\npip install ts-data-generator\n```\n\n### Repo\nAfter cloning this repo and creating a virtual environment, run the following command:\n```bash\npip install --editable .\n```\n\n## Usage\n1. To check out constructing for time series data, check the sample notebook [here](https://github.com/manojmanivannan/ts-data-generator/blob/main/notebooks/sample.ipynb)\n2. To extract the trends from an existing data, check this sample notebook [here](https://github.com/manojmanivannan/ts-data-generator/blob/main/notebooks/imputer.ipynb)\n\n### CLI\n\nYou can also use the command line utility `tsdata` to generate the data.\n```bash\n(venv) ~/ts-data-generator  \ue0a0 cli $ tsdata generate --help\nUsage: tsdata generate [OPTIONS]\n\n  Generate time series data and save it to a CSV file.\n\nOptions:\n  --start TEXT                    Start datetime 'YYYY-MM-DD'  [required]\n  --end TEXT                      End datetime 'YYYY-MM-DD'  [required]\n  --granularity [FIVE_MIN|HOURLY|DAILY]\n                                  Granularity of the time series data  [required]\n  --dims TEXT                     + separated list of dimensions definition of format 'name:function:values'  [required]\n  --mets TEXT                     + separated list of metrics definition trends of format 'name:trend(*params)'  [required]\n  --output TEXT                   Output file name  [required]\n  --help                          Show this message and exit.\n  ```\nFor example you can call this cli tool like below to generate data\n```bash\ntsdata generate \\\n  --start \"2019-01-01\" \\\n  --end \"2019-01-12\" \\\n  --granularity \"FIVE_MIN\" \\\n  --dims \"product:random_choice:A,B,C,D\" \\\n  --dims \"product_id:random_float:1,4\" \\\n  --dims \"const:constant:5\" \\\n  --mets \"sales:LinearTrend(limit=500)+WeekendTrend(weekend_effect=50)\" \\\n  --mets \"trend:LinearTrend(limit=10)\" \\\n  --output \"data.csv\"\n```\n\n#### Release method\n1. `git tag <x.x.x>`\n2. `git push origin <x.x.x>`\n\n<!-- [tutorial]: /notebooks/test.gif -->",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for generating synthetic time series data",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [
        "data generator",
        " python",
        " synthetic data",
        " time series"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "603f395dc18692247499e2ca8a4ace76f894df4702a5a3ff1a376d633ea24af7",
                "md5": "f298985b08aea48970bd3bdad8119cf4",
                "sha256": "030639b23bff9aa411f8f4e46abeeeb9a397318b036660f48364ccf2e83de217"
            },
            "downloads": -1,
            "filename": "ts_data_generator-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f298985b08aea48970bd3bdad8119cf4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 17173,
            "upload_time": "2025-02-19T20:05:29",
            "upload_time_iso_8601": "2025-02-19T20:05:29.033175Z",
            "url": "https://files.pythonhosted.org/packages/60/3f/395dc18692247499e2ca8a4ace76f894df4702a5a3ff1a376d633ea24af7/ts_data_generator-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "51375ff7030059ec2889c4b0f5f02d939097aab10d634996c4d3a725fd9aac29",
                "md5": "0ab2fe3ee721c6b4ddc7f7d4c081b9e0",
                "sha256": "1a6e4bb71a41baa86a1a66101a2f3881b9b332bb4c8d51d1ed0d263bc281110f"
            },
            "downloads": -1,
            "filename": "ts_data_generator-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0ab2fe3ee721c6b4ddc7f7d4c081b9e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 844386,
            "upload_time": "2025-02-19T20:05:33",
            "upload_time_iso_8601": "2025-02-19T20:05:33.129759Z",
            "url": "https://files.pythonhosted.org/packages/51/37/5ff7030059ec2889c4b0f5f02d939097aab10d634996c4d3a725fd9aac29/ts_data_generator-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-19 20:05:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ts-data-generator"
}
        
Elapsed time: 1.42065s