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
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.2.0.tar.gz
(13.6 kB
view hashes)
Built Distribution
mockseries-0.2.0-py3-none-any.whl
(25.7 kB
view hashes)
Close
Hashes for mockseries-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c21c139c79011bc8ba93fc8bdd8300e812a0754117fa98c05865fcb5283e8139 |
|
MD5 | 7bd8cd752fdd329eafc63333eeac4c48 |
|
BLAKE2b-256 | dbda2b3387f09526cc6bd4cf9e738af0100c5374c98525ce8c5c318012aca5ed |