🚀 v0.1.9 - The Initial Release of TimeDataModel
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_timewithout losing original values. - 🗂️ AUDIT: Full audit trail including
changed_byand annotations.
✨ Key Features
- 📦 Containers:
TimeSeries(univariate) andTimeSeriesTable(multivariate). - 🔄 Interoperability: Symmetric
from_*andto_*constructors for Pandas, Polars, NumPy, PyArrow, and Python lists. - 📏 Unit Management: Built-in unit conversion and validation via
pint. - 🌍 Geospatial:
GeoLocationandGeoAreasupport viashapely. - 🏷️ 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
- 📖 Documentation: https://timedatamodel.readthedocs.io
- 💻 Source Code: GitHub
- ⚖️ License: MIT