$ show business-science/pytimetk
PyTimeTK is a Python time series toolkit (port of R's timetk) providing a unified API for time series analysis, feature engineering, visualization, anomaly detection, and financial technical indicators. It supports pandas, Polars, and cuDF backends via a clean engine abstraction layer, enabling transparent multi-engine execution. The library is structured around modular subpackages: core (summarization, padding, future frames), feature_engineering (lags, rolling, expanding, Fourier, wavelet, spline, holiday signatures), finance (MACD, RSI, Bollinger Bands, regime detection, risk metrics), plot (Plotly/Plotnine/Matplotlib), datasets, cross-validation, and a beta FeatureStore with MLflow integration. All functions follow a consistent augment_* pattern, register as DataFrame/GroupBy methods via pandas_flavor, and expose a .tk accessor for Polars. The codebase demonstrates strong engineering practices: extensive unit tests, CI workflows, versioned dependencies, and a clear API surface.
The LLM identified 2 files worth highlighting for reuse:
Provides a generic `FrameConversion` dataclass and functions (`convert_to_engine`, `normalize_engine`, `restore_output_type`) that transparently convert DataFrames between pandas, Polars, and cuDF backends, process them, and restore the original type. This pattern decouples business logic from engine specifics and can be extracted and reused in any project requiring multi-backend DataFrame operations.
Implements a tidy selector system (`contains`, `starts_with`, `ends_with`, `matches`, `ColumnSelector`) for flexible, human-readable column selection. Inspired by R's dplyr select helpers, this pattern solves a common data engineering need and can be extracted and applied to any Python library requiring user-friendly column specification.