Skip to main content

A package for time series data processing and modeling using ARIMA and GARCH models

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Generalized Timeseries

Python Versions PyPI

TODO: Add docker pull

CI/CD readthedocs.io Docker Hub

codecov Codacy Badge

A package for timeseries data processing and modeling using ARIMA and GARCH models.

Features

  • Price series generation for simulation.
  • Data preprocessing including missing data handling and scaling.
  • Stationarity testing and transformation.
  • ARIMA and GARCH models for time series forecasting.

Installation

Install from pypi:

python -m venv venv
source venv/bin/activate
pip install generalized-timeseries

Install from github:

python -m venv venv
source venv/bin/activate
pip install git+https://github.com/garthmortensen/generalized-timeseries.git

Usage

from generalized_timeseries import data_generator, data_processor, stats_model

# generate price series data
price_series = data_generator.generate_price_series(length=1000)

# preprocess the data
processed_data = data_processor.preprocess_data(price_series)

# fit ARIMA model
arima_model = stats_model.fit_arima(processed_data)

# fit GARCH model
garch_model = stats_model.fit_garch(processed_data)

# forecast using ARIMA model
arima_forecast = stats_model.forecast_arima(arima_model, steps=10)

# forecast using GARCH model
garch_forecast = stats_model.forecast_garch(garch_model, steps=10)

print("ARIMA Forecast:", arima_forecast)
print("GARCH Forecast:", garch_forecast)

Publishing Maintenance

Reminder on how to manually push to pypi. This step, along with autodoc build, is automated with CI/CD.

pypi

pip install --upgrade build
pip install --upgrade twine
python -m build  # build the package
twine check dist/  # check it works
twine upload dist/

rm -rf dist build *.egg-info # restart if needed

Design Decisions

Package

This package was created in order to carve out code from a larger thesis remake project. Doing so increased modularity. pyproject.toml is used instead of setup.py to achieve a modern build process for publishing to pypi. It also supports direct pip installation via github clone.

Typehints

Due to there being a fair amount of modules, classes and functions, type hints are used. Variable annotations (myvar: int = 5) are just too visually distracting, and are not used.

Self documenting

To achieve self-documenting code, docstrings (and typehints) are used. Sphinx converts all this metadata into .html and hosted on readthedocs.io.

Test covereage

Unit tests cover the majority of the codebase, to ensure code changes don't break existing functionality. Codecov.io is used to analyze code coverage.

Code quality

Codacy is used to analyze code quality, and highly any insecure programming issues.

Branching

Branches were used early on in the project for the sake of purity, but eventually pragmatism took over.

venv

Virtual environments and requirements.txt enable sandboxed development.

OS support

The code is OS-agnostic, and tested across ubuntu and mac-os. Due to the slow spin-up times of testing on a Windows build, it's been excluded from testing since v0.1.7.

CI/CD

A Github Actions workflow automates the labor involved with pytest, package build (wheels included), pypi distribution, producing sphinx autodocs, and publishing docs to readthedocs.io.

Makefile

Inspired by deepseek's repos, I want to add a makefile.

Docker

In addition to venv, I want to add docker to encapsulate the app and dependencies. This will help run it across different environments.

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

generalized_timeseries-0.1.10.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

generalized_timeseries-0.1.10-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file generalized_timeseries-0.1.10.tar.gz.

File metadata

  • Download URL: generalized_timeseries-0.1.10.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for generalized_timeseries-0.1.10.tar.gz
Algorithm Hash digest
SHA256 b3c7ca86c3cf57c33427c61f6ee3aeeb30c632d0a802e9a97aea17d86bf532fe
MD5 cbff3915927128d5781e63cf6367b829
BLAKE2b-256 7330156faabc5f090ecae504d3569b39b74278cc093e85a2ed4e043835031e80

See more details on using hashes here.

Provenance

The following attestation bundles were made for generalized_timeseries-0.1.10.tar.gz:

Publisher: execute_CICD.yml on garthmortensen/generalized-timeseries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file generalized_timeseries-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for generalized_timeseries-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 75a40f07a667420b65c4241e3ca3a8ccf245f71820da359b06e1745a7253b771
MD5 54c067ebb0a10efbed394c994ff6dc44
BLAKE2b-256 69a1e6953d0d7416e467a3393f8e78ca9e05ea6905e1fcabc2ea953c032699ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for generalized_timeseries-0.1.10-py3-none-any.whl:

Publisher: execute_CICD.yml on garthmortensen/generalized-timeseries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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