Strongly-typed DataFrames for Python, powered by Rust.
Project description
PydanTable
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.18.1 — highlights in the changelog.
Documentation
- Docs (latest): pydantable.readthedocs.io
- Quickstart: Getting started → Quickstart
- Docs map: Getting started → Docs map
What you get
- Typed tables via Pydantic models:
DataFrameModelorDataFrame[Schema] - Typed expressions + lazy plans validated/lowered in Rust
- Explicit materialization:
collect()(rows) orto_dict()(columns), plus optional Arrow/Polars exports - File / HTTP / SQL I/O helpers and integration patterns for services
Key references:
- DataFrameModel: User guide → DataFrameModel
- Execution: User guide → Execution
- Materialization: User guide → Materialization
- Interface contract: Semantics → Interface contract
- I/O overview: I/O → Overview
Install
pip install pydantable
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
- Start here: Quickstart
- Typing guide: User guide → Typing
- I/O decision tree: I/O → Decision tree
- FastAPI golden path: Integrations → FastAPI → Golden path
- Engines: SQL · Mongo · Spark
Development
Use a virtual environment at .venv in the repo root (the Makefile defaults to .venv/bin/python). Full contributor setup, native builds, and contributor notes: Project → Developer.
make check-full # ruff, ty, pyright, typing snippet tests, MkDocs, Rust
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantable-1.18.1.tar.gz.
File metadata
- Download URL: pydantable-1.18.1.tar.gz
- Upload date:
- Size: 211.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
244073c41e8c3f80babd07c32b9db951097815ce2559ba9b735ced049973e92d
|
|
| MD5 |
67969330f81ee152ad3a681f9504e5b9
|
|
| BLAKE2b-256 |
91a144efba0f45687471d0a282f6e874206f5a0c37930ab5687681fe1df5fa7d
|
File details
Details for the file pydantable-1.18.1-py3-none-any.whl.
File metadata
- Download URL: pydantable-1.18.1-py3-none-any.whl
- Upload date:
- Size: 245.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733672f7572a51363d5cc2a973975cf0195926a989249a5aec559d334eb1a510
|
|
| MD5 |
fe462735773cab6ba896d6d972112bcf
|
|
| BLAKE2b-256 |
8a88e439b3fdf624e122b248cbd1484475546123200613ba3e0beb828de18367
|