Skip to content

🚀 v0.1.9 - The Initial Release of TimeDataModel

Choose a tag to compare

@FreaxMATE FreaxMATE released this 19 Mar 09:24
· 17 commits to main since this release
2fddf5f

We are thrilled to announce the initial release of TimeDataModel! ⏱️

TimeDataModel is a lightweight, Pythonic data model for time series data, fully interoperable with NumPy, Pandas, Polars, and PyArrow.

🧊 Overview

TimeDataModel ensures that time series data always travels with its required context. Every series carries metadata including name, unit, frequency, data type, timezone, location, and labels, rather than just raw values.

📊 Supported Data Shapes

  • 📅 SIMPLE: Standard univariate time series indexed by valid_time.
  • 🔁 VERSIONED: Bi-temporal series (valid_time + knowledge_time) for backtesting.
  • ✏️ CORRECTED: Tracks manual corrections via change_time without losing original values.
  • 🗂️ AUDIT: Full audit trail including changed_by and annotations.

✨ Key Features

  • 📦 Containers: TimeSeries (univariate) and TimeSeriesTable (multivariate).
  • 🔄 Interoperability: Symmetric from_* and to_* constructors for Pandas, Polars, NumPy, PyArrow, and Python lists.
  • 📏 Unit Management: Built-in unit conversion and validation via pint.
  • 🌍 Geospatial: GeoLocation and GeoArea support via shapely.
  • 🏷️ Semantic Types: Taxonomy for classifying data (ACTUAL, OBSERVATION, FORECAST, etc.).
  • Performance: Polars-backed for memory-efficient operations.

🛠️ Getting Started

Installation

pip install timedatamodel
# Or with all dependencies (numpy, pandas, pint, geo)
pip install "timedatamodel[all]"

Basic Example

from timedatamodel import TimeSeries, Frequency
import pandas as pd

# Create a series with metadata
df = pd.DataFrame({
    "valid_time": pd.date_range("2024-01-01", periods=24, freq="h"), 
    "value": range(24)
})

ts = TimeSeries.from_pandas(df, name="Load", unit="MW", frequency=Frequency.PT1H)
print(ts)

📚 Resources