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.6.6 
pip install mockseries

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.1.3.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mockseries-0.1.3.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mockseries-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8bf25b924027b8942610b45961a2cc428f003b1cab3cab6521bc11da5ed8ab37
MD5 3a472e9723264f9138ce6d532fe20e33
BLAKE2b-256 5675ad27943f1952925652e9f72beb692ba4414da3521babddc2f38c991f780a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mockseries-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for mockseries-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d985c2250ba00c40f385acae35ce9109caa34b467cbb1567a36dc816302d6015
MD5 35af1213f8cd56dd5fcedd3749c8a928
BLAKE2b-256 1eefcebb3c549987c9d0404aae4e2bce65324391dc8c14149d94a2c99d04a2d0

See more details on using hashes here.

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