Skip to main content

PydanTable

CI Documentation PyPI version Python versions License: MIT

Strongly typed DataFrames for Python, powered by Rust.

PydanTable combines Pydantic schemas with a Polars-backed Rust execution engine to provide a typed, service-friendly DataFrame API (with optional integrations for FastAPI, SQL, MongoDB, Spark, and more).

Current release: 1.19.2 — highlights in the changelog.

Documentation

What you get

  • Typed tables via Pydantic models: DataFrameModel or DataFrame[Schema]
  • Typed expressions + lazy plans validated/lowered in Rust
  • Explicit materialization: collect() (rows) or to_dict() (columns), plus optional Arrow/Polars exports
  • File / HTTP / SQL I/O helpers and integration patterns for services

Key references:

Install

pip install pydantable

Requires Python 3.10+. Wheels include the Rust extension (pydantable-native).

Verify your install

import pydantable
pydantable.DataFrameModel  # import check
from pydantable.engine import native_engine_capabilities
caps = native_engine_capabilities()
assert caps.extension_loaded, "Native extension missing — see Troubleshooting in the docs"

If verification fails, see Troubleshooting or the Installation guide.

Optional extras:

pip install "pydantable[polars]"   # to_polars
pip install "pydantable[arrow]"    # to_arrow / Arrow constructors
pip install "pydantable[io]"       # full file I/O convenience (arrow + polars)
pip install "pydantable[sql]"      # SQLModel + SQLAlchemy + moltres-core lazy SqlDataFrame; add a DB-API driver for your URL
pip install "pydantable[pandas]"   # pandas-flavored façade (pandas UI doc)
pip install "pydantable[fastapi]"  # FastAPI integration (pydantable.fastapi)
pip install "pydantable[mongo]"    # pymongo + Beanie + Mongo plan stack (lazy MongoDataFrame + I/O + from_beanie)
pip install "pydantable[spark]"    # SparkDataFrame / SparkDataFrameModel (raikou-core + pyspark + sparkdantic)

Quick start

from pydantable import DataFrameModel

class User(DataFrameModel):
    id: int
    age: int | None

df = User({"id": [1, 2], "age": [20, None]})
result = (
    df.with_columns(age2=df.age * 2)
    .filter(df.age > 10)
    .select("id", "age2")
)

print(result.to_dict())
print([r.model_dump() for r in result.collect()])

Output (one run):

{'id': [1], 'age2': [40]}
[{'id': 1, 'age2': 40}]

Next steps

Development

Use a virtual environment at .venv in the repo root (the Makefile defaults to .venv/bin/python). See CONTRIBUTING.md and the Developer guide.

make check-full      # ruff, ty, pyright, typing snippet tests, MkDocs, Rust

License

MIT

Metadata

Release files for pydantable 1.19.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantable 1.19.2
File Size Uploaded
pydantable-1.19.2.tar.gz 218.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantable 1.19.2
File Interpreter ABI Platform
pydantable-1.19.2-py3-none-any.whl Python 3 none any Details

Total release size: 473.1 kB

Release files / pydantable-1.19.2.tar.gz

Download URL pydantable-1.19.2.tar.gz
Size 218.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4ad576bf2b89b7375ce0af3d24cbd8211b94b30b3e1718593cc438bb529df6e5
BLAKE2b-256 checksum
How to use checksums
42c10615a0c12981e8c6ffdf021c4d76b365809957093f729dd05f6015c07c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.13

Release files / pydantable-1.19.2-py3-none-any.whl

Download URL pydantable-1.19.2-py3-none-any.whl
Size 254.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9b0eb0c02eca7da8ab19b6b155ac3304c43af55caafa53903e36bb2e13ff3b0
BLAKE2b-256 checksum
How to use checksums
9e68f22f5c8e25bec14d3262724ca598061ac6387b74f5b820f2b2de781135a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

1.19.2 This release

2 release files

1.19.0

2 release files

1.18.1

2 release files

1.18.0

2 release files

1.17.0

2 release files

1.16.1

2 release files

1.7.0

13 release files

1.6.1

13 release files

1.6.0

13 release files

1.5.0

13 release files

1.4.0

13 release files

1.3.0

13 release files

1.2.0

13 release files

1.1.0

13 release files

1.0.0

13 release files

0.9.0

13 release files

0.8.0

13 release files

0.7.0

13 release files

0.6.0

13 release files

0.5.0

13 release files

0.4.0

13 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page