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.4.tar.gz
(12.8 kB
view details)
Built Distribution
File details
Details for the file mockseries-0.1.4.tar.gz
.
File metadata
- Download URL: mockseries-0.1.4.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 819b24fc0b81c92e4b01889abed18d4ef217289df2401cdb5b1241b8f6c366c9 |
|
MD5 | abcaedc8bc5071eea31b3fd7b55fc5ec |
|
BLAKE2b-256 | c4839685f2df85212c3fe92bad85357de863804c83b057152292f3978e6bb9fb |
File details
Details for the file mockseries-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: mockseries-0.1.4-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3804466cb42f2d0e030e276987a0b3cf0bd515fc0f5dd4a5d4b1123b489b59 |
|
MD5 | 48f22cae95ce806a832d23d16f2bc22c |
|
BLAKE2b-256 | d625b1150b8c02710230a64356803c69f72174b0c7b8f293ff957a9daf97b663 |