Metadata-Version: 2.4
Name: timedatamodel
Version: 0.1.1
Summary: A lightweight data model for time series data with pandas, numpy, and polars support
Project-URL: Homepage, https://github.com/rebase-energy/TimeDataModel
Project-URL: Repository, https://github.com/rebase-energy/TimeDataModel
Project-URL: Issues, https://github.com/rebase-energy/TimeDataModel/issues
Author-email: Rebase Energy <sebastian@rebase.energy>
License: MIT
License-File: LICENSE
Keywords: data model,energy,pandas,polars,time series
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: numpy>=2.0
Requires-Dist: pandas>=2.0
Requires-Dist: pint>=0.24
Requires-Dist: shapely>=2.0
Provides-Extra: dev
Requires-Dist: polars>=1.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: polars
Requires-Dist: polars>=1.0; extra == 'polars'
Description-Content-Type: text/markdown

# TimeDataModel

A lightweight Python data model for time series data.

## Features

- `TimeSeries` class with typed timestamps and float/None values
- Flexible `Resolution` (frequency + timezone) and `Metadata`
- Geographic location support (`GeoLocation`, `GeoArea`)
- Native bridges to pandas DataFrames and numpy arrays
- Optional polars support
- JSON and CSV serialization

## Installation

```bash
pip install timedatamodel

# With polars support
pip install timedatamodel[polars]
```

## Quick Start

```python
from datetime import datetime, timezone
from timedatamodel import TimeSeries, Resolution, Metadata
from timedatamodel.enums import Frequency

res = Resolution(Frequency.PT1H, "UTC")
ts = TimeSeries(
    resolution=res,
    metadata=Metadata(name="power", unit="kW"),
    timestamps=[datetime(2024, 1, 1, i, tzinfo=timezone.utc) for i in range(3)],
    values=[100.0, 110.0, 95.0],
)

df = ts.to_pandas_dataframe()
```

## Requirements

Python >= 3.11
