Skip to main content

Easy and intuitive generation of synthetic timeseries.

Project description

mockseries

mockseries is and easy to use and intuitive Python package that helps generate synthetic (mock) timeseries.

-> Documentation website.

Installation

#python >=3.9
pip install mockseries

For older versions of python, here is the compatibility matrix:

mockseries version Python versions
0.3.x 3.9 - 3.12
0.2.x 3.8 - 3.11
0.1.x 3.6 - 3.8

Contributing

Contributions are welcome!
Standards, objectives and process not defined yet.

Quick Run

Define a timeseries

from datetime import timedelta
from mockseries.trend import LinearTrend
from mockseries.seasonality import SinusoidalSeasonality
from mockseries.noise import RedNoise

trend = LinearTrend(coefficient=2, time_unit=timedelta(days=4), flat_base=100)
seasonality = SinusoidalSeasonality(amplitude=20, period=timedelta(days=7)) \
              + SinusoidalSeasonality(amplitude=4, period=timedelta(days=1))
noise = RedNoise(mean=0, std=3, correlation=0.5)

timeseries = trend + seasonality + noise

Generate values

from datetime import datetime
from mockseries.utils import datetime_range

ts_index = datetime_range(
    granularity=timedelta(hours=1),
    start_time=datetime(2021, 5, 31),
    end_time=datetime(2021, 8, 30),
)
ts_values = timeseries.generate(ts_index)

Plot or write to csv

from mockseries.utils import plot_timeseries, write_csv

print(ts_index, ts_values)
plot_timeseries(ts_index, ts_values, save_path="hello_mockseries.png")
write_csv(ts_index, ts_values, "hello_mockseries.csv")

References

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

mockseries-0.3.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

mockseries-0.3.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file mockseries-0.3.0.tar.gz.

File metadata

  • Download URL: mockseries-0.3.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for mockseries-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fa0e07b85abec057e467bdca49436a81c64dc4676c12abb399120d26aedd634d
MD5 318760de8eaf52a6c5674b41ce071607
BLAKE2b-256 cf2c111bff286d7a5b714bd5bf950fcb16545d598dacbf20b7dd7544f1ad6ae7

See more details on using hashes here.

File details

Details for the file mockseries-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mockseries-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for mockseries-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2543d7a03b50aa1425cc2c74629da88bde84c64bdc3d3daa6db64061715b225
MD5 f143bc4422aff7f9f004b71ab6248016
BLAKE2b-256 6478c3848247e0e2754a312e4daa6ca2b83c49dd788d5eac42ab0d93a53331d1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page