Skip to main content

(dsv,jetstream) --> dataframe <--> bitemporal-tables

Project description

polars-hist-db

A Python library for building bitemporal data pipelines with Polars and MariaDB.

It ingests data from DSV files or NATS JetStream subjects, tracks history using MariaDB's system-versioned tables, and exposes everything as strongly-typed Polars DataFrames.

Features

  • Typed uploads — push Polars DataFrames into MariaDB with automatic type mapping between Polars, SQL, and SQLAlchemy.
  • Typed queries — read tables back into DataFrames with column types inferred from the database schema. Temporal query hints (asof, span, all) let you slice history without writing SQL.
  • YAML-driven pipelines — define scrape specifications that handle column typing, enrichment via custom transform functions, normalization across tables, and foreign-key deduction.
  • Deduplication — an audit log tracks what has already been ingested so re-runs skip previously processed files or messages.
  • Transactional ingestion — each file or message is processed in its own transaction; failures roll back cleanly without affecting other items.
  • Dual input sources — crawl directories for DSV files, or consume messages from NATS JetStream with configurable fetch/subscription strategies.
  • Delta upserts — staging tables detect changed rows, handle duplicates (take_first, take_last, error), and optionally mark disappeared rows as dropped.

Full documentation: jr200.github.io/polars-hist-db

Quick Start

uv sync
make test

Development

make check       # ruff + mypy
make docs        # render and preview quarto docs
make bump PART=patch
make release

License

This project is licensed under the MIT license.

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

polars_hist_db-0.12.0.tar.gz (736.5 kB view details)

Uploaded Source

Built Distribution

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

polars_hist_db-0.12.0-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file polars_hist_db-0.12.0.tar.gz.

File metadata

  • Download URL: polars_hist_db-0.12.0.tar.gz
  • Upload date:
  • Size: 736.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for polars_hist_db-0.12.0.tar.gz
Algorithm Hash digest
SHA256 1bd3383fdcde25d70039699652176ea57b6b22dbbd43e635144ae5a370297a9a
MD5 0c30a393916f702f5a88f9e12cac8650
BLAKE2b-256 abee92c392f8f9e27156ec80c7550213f6c4d57419e86cb43fa8def272fdd84a

See more details on using hashes here.

File details

Details for the file polars_hist_db-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: polars_hist_db-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 61.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for polars_hist_db-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cbe02cfe85d156a1b29a0347f45837af72ca5248a0be818eb03cb6d78461e2d
MD5 990bdc17f741cc7ed7b3c2e5dcb5a469
BLAKE2b-256 5acb2f6edc4c05695de56b25149e266b82f5d0b8ec8211380ef60e1cdcf0d0c5

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