Skip to main content

A lightweight data model for time series data with pandas, numpy, and polars support

Project description

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

pip install timedatamodel

# With polars support
pip install timedatamodel[polars]

Quick Start

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

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

timedatamodel-0.1.1.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

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

timedatamodel-0.1.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file timedatamodel-0.1.1.tar.gz.

File metadata

  • Download URL: timedatamodel-0.1.1.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timedatamodel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 81a78e887cec8e45076f48595147e84a97742a10ed399b2cac805e1e6749a272
MD5 b98db6904f39020790b4d80f13703449
BLAKE2b-256 9160acaafc2496015dbe202e36681c87f3702c04a8c1d9ef8a727b8d5158749b

See more details on using hashes here.

File details

Details for the file timedatamodel-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: timedatamodel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timedatamodel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac4d6486af7e48542deb5c396b7a6e2b9802848e0e1b25400aaf5ff81d8bd11
MD5 19b74091205bbac866e006fff543f7fd
BLAKE2b-256 90697c7159316653d89c20dc5607877d2e53ad89ba8174c286361ccee822b1af

See more details on using hashes here.

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