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.
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
- J. R. Maat, A. Malali, and P. Protopapas, “TimeSynth: A Multipurpose Library for Synthetic Time Series in Python,” 2017. [Online]. Available: http://github.com/TimeSynth/TimeSynth.
- TStimulus. Available: https://github.com/cetic/TSimulus.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mockseries-0.3.1.tar.gz.
File metadata
- Download URL: mockseries-0.3.1.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf310c441590a93df5f025245dcfbeb8e38048f9e27d73b4d66475dd0eeb8cd
|
|
| MD5 |
b942d706aa63e184ea06948cd51db50d
|
|
| BLAKE2b-256 |
5cc18cb7e85f18a943dbd46a4fab1bdca123dcb33b9e331a11bff8ee3826f7fb
|
File details
Details for the file mockseries-0.3.1-py3-none-any.whl.
File metadata
- Download URL: mockseries-0.3.1-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a44ee649a45dce8af729fc2d1baabbbbf424682371b99b9ff1e75e4d0c755965
|
|
| MD5 |
4baec907a583e4d506c52757d1dafd75
|
|
| BLAKE2b-256 |
7fcfbcd47cd293d2a802e7e077fc2cc7a7efd244fa1b025f5b39d03288f2968f
|