pandas backend adapter for PlanFrame.
Project description
planframe-pandas
pandas adapter package for PlanFrame. Import as planframe_pandas.
Documentation (ReadTheDocs):
- pandas track (end users):
https://planframe.readthedocs.io/en/latest/planframe_pandas/ - Light API reference:
https://planframe.readthedocs.io/en/latest/planframe_pandas/reference/api/
Install
pip install planframe-pandas
Usage
from planframe_pandas import PandasFrame
class User(PandasFrame):
id: int
age: int
pf = User([{"id": 1, "age": 10}, {"id": 2, "age": 20}])
rows = pf.select("id").to_dicts()
Notes
- Core v1.2+ (
planframe): shared helpers includeexecute_plan_async,planframe.materialize, Expr operator IR, and Frame*_asyncaliases—see Migrating since v1.1.0. PandasFramesubclasses coreplanframe.pandas.PandasLikeFrame, so you get pandas-flavored helpers (assign,sort_values, boolean indexing, columnfilter,astype,eval,drop_duplicates, …) on top of the sharedFrameplan. See the pandas-like API guide.- PlanFrame is always lazy: chaining does not touch backend data; execution happens at
collect()boundaries. collect()returnslist[pydantic.BaseModel]. Usecollect_backend()for apandas.DataFrame, orstream_dicts()/stream()to iterate rows (see Streaming rows).
Common transforms
with_row_index(name="row_nr", offset=0): add a monotonically increasing row number column.clip(lower=..., upper=..., subset=...): clamp numeric columns (ifsubset=None, clamps all numeric schema fields).cast_many/cast_subset: multi-column cast helpers.fill_null_many/fill_null_subset: multi-column fill-null helpers.rename_upper/lower/title/strip(...): schema-driven rename helpers.pivot_longer(...)/pivot_wider(...): reshape convenience wrappers aroundmelt/pivot.
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
planframe_pandas-1.2.0.tar.gz
(13.5 kB
view details)
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 planframe_pandas-1.2.0.tar.gz.
File metadata
- Download URL: planframe_pandas-1.2.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac2bbdb3d695638f4d3722e19ac90e926c79f49fdabd25f09ce3eb2a96bdfff
|
|
| MD5 |
79fa1c3f5c18130f0a863f2130b985a6
|
|
| BLAKE2b-256 |
67bd2f3480dde60dc511b093dc974f73af8db860548388512f8065c6d846dd78
|
File details
Details for the file planframe_pandas-1.2.0-py3-none-any.whl.
File metadata
- Download URL: planframe_pandas-1.2.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b17cd7a1ea35e5c66fb66df67a7df9fe2a7f8e15db376a07c5e6620ad9bbadf8
|
|
| MD5 |
dac7b68bebe949477cb2f7cbe1807deb
|
|
| BLAKE2b-256 |
bb33a3d90240c3ecf14f6710c9fa072bd55a1b48e7a702be88e149bd873deb39
|