Skip to main content

Strongly-typed DataFrames for Python, powered by Rust.

Project description

PydanTable

CI Documentation PyPI version Python versions License: MIT

Typed dataframe transformations for FastAPI and Pydantic services, backed by a Rust execution core.

Current release: 0.5.0 · Python 3.10+


Documentation

The full manual lives on Read the Docs:

https://pydantable.readthedocs.io/en/latest/

That site is the supported entry point for concepts, contracts, API notes, and examples. The sections below point to the same pages so you can jump straight from GitHub.

Topic Read the Docs
Home / overview Documentation home
DataFrameModel contract (inputs, transforms, collisions, materialization) DataFrameModel (SQLModel-like)
Column types (scalars, structs, list[T], nullability, unsupported cases) Supported data types
FastAPI (routers, bodies, collect, responses) FastAPI integration
Execution model (collect, to_dict, to_polars, optional Python Polars, UI modules) Execution (Rust engine)
Semantics (nulls, joins, ordering, reshaping, windows — Polars-style contract) Interface contract
Roadmap (what shipped in 0.5.0, path to v1.0.0) Roadmap
Why not use Polars directly? Why not just use Polars?
Pandas-style imports (pydantable.pandas) Pandas UI
PySpark-style imports (pydantable.pyspark) PySpark UI
PySpark helpers & parity PySpark interface · PySpark API parity
Polars parity (scorecard, workflows, transformation roadmap) Parity scorecard · Polars-style workflows · Transformation parity roadmap
Contributors (build, test, benchmarks, releases) Developer guide
Plan / vision (architecture phasing) Plan document
Python API reference (autodoc) API reference

For copy-paste convenience, the site base URL is:

https://pydantable.readthedocs.io/en/latest/


What PydanTable does

PydanTable keeps Pydantic models as the source of truth for:

  • column types and nullability (Optional[T] / T | None)
  • typed expressions — invalid combinations fail when the expression is built (Rust AST), not only at runtime
  • schema evolution — chained transforms produce new model types with stable rules (e.g. with_columns name collisions)

The default API feels Polars-like; optional pydantable.pandas and pydantable.pyspark modules only change naming and imports — execution is always the native core. Details: Execution, Interface contract.


Install

pip install pydantable

Optional Python Polars (for to_polars() only):

pip install 'pydantable[polars]'

From a git checkout, the Rust extension must be built (e.g. with maturin):

pip install .

See Developer guide — local setup for maturin develop, release builds, and CI parity.


Quick start

from pydantable import DataFrameModel

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

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

print(df4.to_dict())

Example output:

{'age2': [40], 'id': [1]}
  • Materialization: collect() returns a list of Pydantic row models; to_dict() returns columnar dict[str, list].

  • Alternate UIs:

    from pydantable.pandas import DataFrameModel as PandasDataFrameModel
    from pydantable.pyspark import DataFrameModel as PySparkDataFrameModel
    from pydantable import DataFrameModel as DefaultDataFrameModel
    

More examples: FastAPI integration, Polars-style workflows.


Development

ruff format . && ruff check .
pytest -q

Rust + Python: see Developer guide (formatting, maturin, benchmarks, contribution workflow).


License

MIT

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

pydantable-0.5.0.tar.gz (107.4 kB view details)

Uploaded Source

Built Distributions

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

pydantable-0.5.0-cp313-cp313-win_arm64.whl (16.6 MB view details)

Uploaded CPython 3.13Windows ARM64

pydantable-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pydantable-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

pydantable-0.5.0-cp312-cp312-win_amd64.whl (18.3 MB view details)

Uploaded CPython 3.12Windows x86-64

pydantable-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pydantable-0.5.0-cp312-cp312-musllinux_1_2_aarch64.whl (15.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

pydantable-0.5.0-cp312-cp312-manylinux_2_28_aarch64.whl (15.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pydantable-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pydantable-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pydantable-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

pydantable-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pydantable-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl (16.4 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file pydantable-0.5.0.tar.gz.

File metadata

  • Download URL: pydantable-0.5.0.tar.gz
  • Upload date:
  • Size: 107.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for pydantable-0.5.0.tar.gz
Algorithm Hash digest
SHA256 00aecd665fd96493e90a964b50459af0510fd3f152eaace63b9a9355a779a60f
MD5 3e57f846c8e544f3713f254814f67f6c
BLAKE2b-256 11d7567ea6fef9945f038084030d7580416ad759e09b0d1738b168f496e097a9

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp313-cp313-win_arm64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 c181c2abe4d3b679cde509c3fbd39403c9e742c427ef88b172fa449dc186cbf0
MD5 1ecd1c37109b5d99545f9fda6ccddbeb
BLAKE2b-256 7acd16730dbeb7848234ba20faa156f3653ecbf29e98e6e7c0865e2b64058274

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1afa5bbfa9d0f3f50c304583f35f55e6293976b0e8e502ffdbf84545123b181e
MD5 48ce2a8634db3d1346a79ac6b23c5714
BLAKE2b-256 13000e9bb1c1882dc4259ec0bde1750f28743dd470e5ff8f2fd6f3d746cd7bf9

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f924158dd181c0f280ffa4b36af94cf509d921fa22364e7c99d08df7f7f873b9
MD5 37bc55a1274c8519336db95355cfa8ee
BLAKE2b-256 d3887a79e5a013e07af4b8d1d3aba0f934aa43b6189c7d2bf50fb91ed58ee55f

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e84b60b3610e0900f4b312c37d4491d944dff60d57ccbef9593e3c5c9bcb80e6
MD5 3d429d101a9e8bba2e8e6fb2058590f0
BLAKE2b-256 849223a5003cb07c6a543aaaeda27cce1bdc3b72628f06e33097fa9420eaadec

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5fcc7ef0ca035c8153722be0e61d7e500a62bdac4070cecd7c91e650feadd24b
MD5 fb2786db278b7572b57487793b6670b9
BLAKE2b-256 f6f6a8b24654297c561ee099b6a82b7fc84589ec651993edcce57cd5d98dde43

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 642eda29f1e7dbb96869a7e1859bcc64da63d9636456580c83df2894a4c77f60
MD5 116dd0222bd8c30567a35e812c36d6a8
BLAKE2b-256 656a018b3fa0962391567c8190709eacd3636d821d3741bcd47c69b875e5033d

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54aaecf08bde0cc1874f0e74cc39d421eef14b914d7d394987fd303d693349f8
MD5 7e90dfb4e4c805c9fb7be98c3c950b4f
BLAKE2b-256 df66e3f81ac2ed1138d554d2296a81d1a825a82ca6a80183ef2fd43f4a876de1

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89732d5f06764bedcd54b1765a00b092ca38c480a1d7a9d6b2f27dd7cd530ee3
MD5 d9f1452b49bfa0a116be997a1878d681
BLAKE2b-256 85d94fedbedeb0da92ffcd634646923e0b09d35f01fc1a310c3cd5a636146eb8

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69ad1420c2c321663878c0114a56712a3ca1aab56bcba61394c558e2e6b80968
MD5 67d59d85385809e4c1ad4e3600573666
BLAKE2b-256 274d639b11d879f6af8ec8be6522e1e9f1e6896982c276fecc5b63ae6cdcc257

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 657c2b85655590ff66801dfedbb025e11a0f54480f7521b810b22a0e0c56afae
MD5 11a893de87cefc1ca2531160a7b09fef
BLAKE2b-256 1bbb96ae00cc71ed0987f42e24826fc30c29c86edc4065bc9031dbbbe8a77080

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb0b4f29960bbac3c9f7f64786e264629b220c44c2af4866f5714677312646f2
MD5 d45a2e99cb987a89771c5f1f511c41a5
BLAKE2b-256 a9c18ea378720d9daed0bbc88db4e3802110a2f67e8b2ffdd920b9877321b51b

See more details on using hashes here.

File details

Details for the file pydantable-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ead175b1739cd209a934942edcb3f9556ada2e5dfbbe5b64be6e653bada708cf
MD5 d1ee028e952a202d6a62e20ba6942665
BLAKE2b-256 9389c98a3430f95c999612ae5e806ee22768497e14b39da38399f0c782af8c4a

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