Metadata-Version: 2.4
Name: pydantable
Version: 1.19.1
Summary: Strongly-typed DataFrames for Python, powered by Rust.
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: pydantic<3,>=2.0
Requires-Dist: pydantable-protocol==1.19.1
Requires-Dist: pydantable-native==1.19.1
Requires-Dist: typing-extensions>=4.7
Provides-Extra: arrow
Requires-Dist: pyarrow>=14.0; extra == "arrow"
Provides-Extra: polars
Requires-Dist: polars<2,>=1.0.0; extra == "polars"
Provides-Extra: io
Requires-Dist: pyarrow>=14.0; extra == "io"
Requires-Dist: polars<2,>=1.0.0; extra == "io"
Provides-Extra: sql
Requires-Dist: sqlalchemy<3,>=2.0; extra == "sql"
Requires-Dist: sqlmodel<0.1,>=0.0.22; extra == "sql"
Requires-Dist: moltres-core<2,>=1.0.0; extra == "sql"
Requires-Dist: greenlet>=3.0; extra == "sql"
Provides-Extra: cloud
Requires-Dist: fsspec>=2023.0; extra == "cloud"
Provides-Extra: excel
Requires-Dist: openpyxl>=3.1; extra == "excel"
Provides-Extra: kafka
Requires-Dist: kafka-python>=2.0; extra == "kafka"
Provides-Extra: bq
Requires-Dist: google-cloud-bigquery>=3.0; extra == "bq"
Provides-Extra: snowflake
Requires-Dist: snowflake-connector-python>=3.0; extra == "snowflake"
Provides-Extra: rap
Requires-Dist: rapcsv>=0.2; extra == "rap"
Requires-Dist: rapfiles>=0.1; extra == "rap"
Requires-Dist: rapsqlite>=0.1; extra == "rap"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100; extra == "fastapi"
Provides-Extra: mongo
Requires-Dist: entei-core<0.3,>=0.2.0; extra == "mongo"
Requires-Dist: pymongo>=4.6; extra == "mongo"
Requires-Dist: beanie<3,>=1.24; extra == "mongo"
Provides-Extra: spark
Requires-Dist: raikou-core==0.1.0; extra == "spark"
Requires-Dist: pyspark<4,>=3.4; extra == "spark"
Requires-Dist: sparkdantic<3,>=2.0; extra == "spark"
Provides-Extra: dev
Requires-Dist: tomli>=1.2.0; python_version < "3.11" and extra == "dev"
Requires-Dist: fastapi>=0.100; extra == "dev"
Requires-Dist: httpx>=0.24; extra == "dev"
Requires-Dist: sqlalchemy<3,>=2.0; extra == "dev"
Requires-Dist: sqlmodel<0.1,>=0.0.22; extra == "dev"
Requires-Dist: python-multipart>=0.0.6; extra == "dev"
Requires-Dist: hypothesis>=6.0; extra == "dev"
Requires-Dist: mongomock>=4.1; extra == "dev"
Requires-Dist: pymongo>=4.6; extra == "dev"
Requires-Dist: jinja2>=3.1; extra == "dev"
Requires-Dist: numpy>=1.24; extra == "dev"
Requires-Dist: pyarrow>=14.0; extra == "dev"
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.0; extra == "dev"
Requires-Dist: pytest-randomly>=3.0; extra == "dev"
Requires-Dist: ruff>=0.8.0; extra == "dev"
Requires-Dist: ty>=0.0.28; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: pyright>=1.1.0; extra == "dev"
Requires-Dist: coverage[toml]>=7.0; extra == "dev"
Requires-Dist: diff-cover>=9.0; extra == "dev"
Requires-Dist: polars<2,>=1.0.0; extra == "dev"
Requires-Dist: streamlit<2,>=1.30; extra == "dev"
Requires-Dist: dataframe-api-compat>=0.2.7; extra == "dev"
Requires-Dist: fsspec>=2023.0; extra == "dev"
Requires-Dist: google-cloud-bigquery>=3.0; extra == "dev"
Requires-Dist: kafka-python>=2.0; extra == "dev"
Requires-Dist: openpyxl>=3.1; extra == "dev"
Requires-Dist: pandas>=2.0; extra == "dev"
Requires-Dist: rapcsv>=0.2; extra == "dev"
Requires-Dist: rapfiles>=0.1; extra == "dev"
Requires-Dist: rapsqlite>=0.1; extra == "dev"
Requires-Dist: snowflake-connector-python>=3.0; extra == "dev"
Requires-Dist: entei-core<0.3,>=0.2.0; extra == "dev"
Requires-Dist: beanie<3,>=1.24; extra == "dev"
Requires-Dist: moltres-core<2,>=1.0.0; extra == "dev"
Requires-Dist: greenlet>=3.0; extra == "dev"
Requires-Dist: sparkdantic<3,>=2.0; extra == "dev"
Provides-Extra: benchmark
Requires-Dist: maturin<2.0,>=1.4; extra == "benchmark"
Requires-Dist: pandas>=2.0; extra == "benchmark"
Requires-Dist: polars<2,>=1.0.0; extra == "benchmark"
Provides-Extra: pandas
Requires-Dist: pandas>=2.0; extra == "pandas"
Provides-Extra: docs
Requires-Dist: mkdocs-material<10,>=9.5; extra == "docs"
Requires-Dist: mkdocstrings[python]<1,>=0.25; extra == "docs"
Requires-Dist: mkdocstrings-python<2,>=1.10; extra == "docs"
Requires-Dist: pymdown-extensions<11,>=10.14; extra == "docs"
Requires-Dist: sqlalchemy<3,>=2.0; extra == "docs"
Requires-Dist: sqlmodel<0.1,>=0.0.22; extra == "docs"
Requires-Dist: entei-core<0.3,>=0.2.0; extra == "docs"
Requires-Dist: pymongo>=4.6; extra == "docs"
Requires-Dist: beanie<3,>=1.24; extra == "docs"
Requires-Dist: raikou-core==0.1.0; extra == "docs"
Requires-Dist: pyspark<4,>=3.4; extra == "docs"
Requires-Dist: sparkdantic<3,>=2.0; extra == "docs"
Dynamic: license-file

# PydanTable

[![CI](https://github.com/eddiethedean/pydantable/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/eddiethedean/pydantable/actions/workflows/ci.yml?query=branch%3Amain)
[![Documentation](https://readthedocs.org/projects/pydantable/badge/?version=latest)](https://pydantable.readthedocs.io/en/latest/)
[![PyPI version](https://img.shields.io/pypi/v/pydantable)](https://pypi.org/project/pydantable/)
[![Python versions](https://img.shields.io/pypi/pyversions/pydantable)](https://pypi.org/project/pydantable/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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.1 — highlights in the [changelog](https://pydantable.readthedocs.io/en/latest/project/changelog/).

## Documentation

- **Docs (latest):** [pydantable.readthedocs.io](https://pydantable.readthedocs.io/en/latest/)
- **Quickstart:** [Getting started → Quickstart](https://pydantable.readthedocs.io/en/latest/getting-started/quickstart/)
- **Docs map:** [Getting started → Docs map](https://pydantable.readthedocs.io/en/latest/getting-started/docs-map/)
- **Documentation chat (RAG):** [pydantable-rag/README.md](https://github.com/eddiethedean/pydantable/blob/main/pydantable-rag/README.md) — backend and deployment for the docs assistant; the chat widget is on the hosted docs above.

## 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:

- **DataFrameModel:** [User guide → DataFrameModel](https://pydantable.readthedocs.io/en/latest/user-guide/dataframemodel/)
- **Execution:** [User guide → Execution](https://pydantable.readthedocs.io/en/latest/user-guide/execution/)
- **Materialization:** [User guide → Materialization](https://pydantable.readthedocs.io/en/latest/user-guide/materialization/)
- **Interface contract:** [Semantics → Interface contract](https://pydantable.readthedocs.io/en/latest/semantics/interface-contract/)
- **I/O overview:** [I/O → Overview](https://pydantable.readthedocs.io/en/latest/io/overview/)

## Install

```bash
pip install pydantable
```

Optional extras:

```bash
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

```python
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):

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

## Next steps

- **Start here:** [Quickstart](https://pydantable.readthedocs.io/en/latest/getting-started/quickstart/)
- **Typing guide:** [User guide → Typing](https://pydantable.readthedocs.io/en/latest/user-guide/typing/)
- **I/O decision tree:** [I/O → Decision tree](https://pydantable.readthedocs.io/en/latest/io/decision-tree/)
- **FastAPI golden path:** [Integrations → FastAPI → Golden path](https://pydantable.readthedocs.io/en/latest/integrations/fastapi/golden-path/)
- **Engines:** [SQL](https://pydantable.readthedocs.io/en/latest/integrations/engines/sql/) · [Mongo](https://pydantable.readthedocs.io/en/latest/integrations/engines/mongo/) · [Spark](https://pydantable.readthedocs.io/en/latest/integrations/engines/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](https://pydantable.readthedocs.io/en/latest/project/developer/).

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

## License

MIT
