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 workflows for Python services, with Pydantic schemas and a Rust execution core.

Why PydanTable

  • Define table shape once using Pydantic types.
  • Catch many errors early with typed expressions.
  • Use familiar DataFrame operations (select, filter, join, group_by, windows).
  • Materialize as row models or dict[str, list], depending on API needs.
  • Fit cleanly into FastAPI request/response flows.

Install

pip install pydantable

Common 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]"     # fetch_sql / write_sql helpers

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())   # {'id': [1], 'age2': [40]}
print(result.collect())   # list of Pydantic row models

Core concepts

  • DataFrameModel: SQLModel-like table class (class Orders(DataFrameModel): ...).
  • DataFrame[Schema]: generic API over your own Pydantic BaseModel.
  • Expr: typed expressions used in transforms.
  • Materialization:
    • collect() -> list of row models
    • to_dict() -> dict[str, list]
    • to_polars() / to_arrow() with matching extras installed

I/O at a glance

  • Lazy file pipelines: read_* / aread_* -> transform -> write_*
  • Eager reads: materialize_*, fetch_sql, fetch_*_url
  • Eager writes: export_*, write_sql
  • Full I/O API is in pydantable.io

Validation controls

  • Strict by default on constructors.
  • Optional ingest controls: trusted_mode, ignore_errors, on_validation_errors.
  • Missing optional fields are controlled by fill_missing_optional (default True).

Documentation

Development

make check-full

Contributor setup and release workflow: DEVELOPER

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-1.0.0.tar.gz (181.2 kB view details)

Uploaded Source

Built Distributions

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

pydantable-1.0.0-cp313-cp313-win_arm64.whl (20.3 MB view details)

Uploaded CPython 3.13Windows ARM64

pydantable-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pydantable-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl (21.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

pydantable-1.0.0-cp312-cp312-win_amd64.whl (22.2 MB view details)

Uploaded CPython 3.12Windows x86-64

pydantable-1.0.0-cp312-cp312-musllinux_1_2_x86_64.whl (20.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pydantable-1.0.0-cp312-cp312-musllinux_1_2_aarch64.whl (18.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

pydantable-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pydantable-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl (21.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

pydantable-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl (21.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pydantable-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pydantable-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl (21.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

pydantable-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: pydantable-1.0.0.tar.gz
  • Upload date:
  • Size: 181.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pydantable-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9eb3aadfa81a5b7a354c3301a652894e3cc9994883b77f59135e8363c0de4c24
MD5 474fe17f94f58379b428314747e3709c
BLAKE2b-256 b6ea52f1a5010c10e2e4a140e0223fa2a3dc78a7ed028967e04f7b877422f908

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydantable-1.0.0-cp313-cp313-win_arm64.whl
  • Upload date:
  • Size: 20.3 MB
  • Tags: CPython 3.13, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.13.11

File hashes

Hashes for pydantable-1.0.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 959ef3b180ff4b8911a6ac82867afb512984f52a06059aef446fed74b1398228
MD5 a354d3583a17d849132eaa654fe5f08b
BLAKE2b-256 56032e99946f45f731bdff65662e098bef6d1ac984a626a6c3fc790cf939bb0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de7e5cd66d95dd5f18abfa9e9d35ec1d9b5e169ccf94bf1cfc09a6476f0d1377
MD5 180acc62b67469722a7a6463ae7b9d91
BLAKE2b-256 fdd0a34d61367deced6c73f80323f8a5f9efe7ce347b6782e97fd20b5e71dfc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 369e5d7ce1f3ead667e3736b2f0836e93defdaf8edd854e8b72dc64da68659eb
MD5 1ddb4af1fdbe34219e5f7d6df2813e5e
BLAKE2b-256 b3ea741d6c2d1b1363d111d13aa0b6d0a5656695e45cba2125d61c5189907df3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydantable-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 22.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.10

File hashes

Hashes for pydantable-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b8ff2d95e9c82e8ac7fce6f212be6c926e6dbe757deb7b18d18351fbf7766fcb
MD5 52d620ff17a139e254a915ce43d4f039
BLAKE2b-256 25626fe40a7e57bffddb34411c26c29bc47e3dd8a6b70e1677cf725977b94f89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 22e1d9beb58b37d7fd4c3255383b7d108f1b1dcb76b0bc1ebe7a41fc8624876e
MD5 10cf5a1ae1abb3f200162cfeb8f783bd
BLAKE2b-256 44f47fc2d1311065278abacf2c063ec1adad6bb9d81d14f413876b0524d621a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8e6d1634131b91f3d9ae215e96bd7af30deb1f91d0cb39bf62d696a402cd336a
MD5 90f2a9eef508ec903096b6610961cd39
BLAKE2b-256 efa71ef5093b1cc5fd5bee06db076ba58531762f01e5ae58a408f8ed8991a70f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31f80727c0fd6fc27e7e9e868590f500e847d8c6b6918b8447d4ca39a099b866
MD5 04077e29b56ac15293903ff350a5ef05
BLAKE2b-256 7ca79d02602272b460daa627553e679031f0d6468e49cf8e3755b86cf194397e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9dff5ec6ec05c9dc5dfd9571583811d2f6a9011fd1f3d370bf7340ab09225892
MD5 050951679979f73e3598fbc5876143c8
BLAKE2b-256 395786704bb1dfef86f581b0488882fb1fc4abff9ef05e17cf071177bf8a3250

See more details on using hashes here.

File details

Details for the file pydantable-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pydantable-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d7c43f46a52a17eb6e5b0e5354545f91ee68b4332a9bb27e72d6bf546812ca3b
MD5 5ee940e2696b46f24d82d87cccd142c6
BLAKE2b-256 01d9c2802012abcdff548acde6ec2499f874f78a858d27914e21501d393a5a5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 871d7315821fb7c057a8853c4f0c4d23ba3c263c1810775302c2bfa4bce299a8
MD5 5610197beab5ca3fb9a5fee883b2bb31
BLAKE2b-256 a1930383fc8569940713c714d6afc0ad6870a0b501aec06dc7f92092daf89c7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantable-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5fd6d5aa80a1813439a809727c7d36596a8ce8f8328065c8c322db88c8fb7063
MD5 80eb5282bfa147ac92b06d0e2211193b
BLAKE2b-256 589e9efd30f275aad967237d97d573ea851c5fc0fc593dea2dd5b05c4b76d911

See more details on using hashes here.

File details

Details for the file pydantable-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydantable-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71795c06d9905554bff98ad63979f2eb1c0f7c1ea6d3c30ff14d3ab3ea282743
MD5 f0a7b44e8a5c444549ff95e341cc6507
BLAKE2b-256 7147af1989b295b5ad4a66efcbdce2c647165a0b5bd5bc2af4b5613508494dc0

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