Skip to main content

Core typed relational planning layer for Python DataFrames.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

planframe

Docs PyPI License: MIT

Core package for PlanFrame (typed planning layer). Import as planframe.

Documentation (ReadTheDocs):

  • Core (adapter authors): https://planframe.readthedocs.io/en/latest/planframe/
  • Design docs: https://planframe.readthedocs.io/en/latest/planframe/design/
  • Light API reference: https://planframe.readthedocs.io/en/latest/planframe/reference/api/

What you get

  • planframe.Frame: immutable, schema-aware transformation plan (always lazy)
  • planframe.expr: typed expression IR (col, lit, arithmetic/compare/boolean ops, coalesce, if_else, etc.), plus aggregation wrappers for use inside group_by(...).agg(...): agg_sum, agg_mean, agg_min, agg_max, agg_count, agg_n_unique (these build AggExpr nodes)
  • planframe.groupby.GroupedFrame: produced by Frame.group_by; group_by accepts column names and/or expressions (expression keys show up as __pf_g0, __pf_g1, … in the result schema). agg accepts (op, column) tuples and/or AggExpr values—not arbitrary bare expressions
  • planframe.schema: schema reflection (dataclass + Pydantic) and materialization

Note on backends

planframe is backend-agnostic. It does not execute anything until collect() (even for eager backends). To execute plans you need an adapter package (e.g. planframe-polars).

For async stacks, Frame.acollect(), Frame.ato_dicts(), and Frame.ato_dict() await adapter hooks (BaseAdapter.acollect and friends); defaults run sync methods in a thread pool. See https://planframe.readthedocs.io/en/latest/planframe/design/backend-adapter-design/.

Typing

PlanFrame includes py.typed plus generated stubs (notably planframe/frame.pyi) to improve static typing in editors and Pyright.

If you modify the Frame API, regenerate stubs from the repo root:

python scripts/generate_typing_stubs.py
python scripts/generate_typing_stubs.py --check

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

planframe-0.3.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

planframe-0.3.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file planframe-0.3.0.tar.gz.

File metadata

  • Download URL: planframe-0.3.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for planframe-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4109b2adb3850aa75e724abf991acf76056912a2fb567e176007e2df67e05029
MD5 7879460785f4903187ca69084ead2dff
BLAKE2b-256 cf5ddaf900a9522cfaebe7cb4e919b8a3e6d853ccd91d7e9d202806c2455fad6

See more details on using hashes here.

File details

Details for the file planframe-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: planframe-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for planframe-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3999bcb0d6ac7918e9bb528e9b6e4ccb383c2ce0eaad0543b1b42a95e073a72
MD5 19903865a477e4b02a044b5b763d37dc
BLAKE2b-256 596451cf3fc6539dab8675c104136143bed850c93b448985a5d8ba163539ed96

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