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.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
- 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
mockseries-0.1.3.tar.gz
(13.4 kB
view details)
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bf25b924027b8942610b45961a2cc428f003b1cab3cab6521bc11da5ed8ab37
|
|
| MD5 |
3a472e9723264f9138ce6d532fe20e33
|
|
| BLAKE2b-256 |
5675ad27943f1952925652e9f72beb692ba4414da3521babddc2f38c991f780a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d985c2250ba00c40f385acae35ce9109caa34b467cbb1567a36dc816302d6015
|
|
| MD5 |
35af1213f8cd56dd5fcedd3749c8a928
|
|
| BLAKE2b-256 |
1eefcebb3c549987c9d0404aae4e2bce65324391dc8c14149d94a2c99d04a2d0
|