Skip to main content

Small helpers for fast Parquet/CSV: column pruning, optional integer range filters with PyArrow pushdown, footer-only schema.

Project description

snapparquet

Project description

snapparquet provides small, dependency-light helpers for fast Parquet workflows in Python: column pruning (read only the fields you need), optional integer-column range filters with PyArrow dataset predicate pushdown when row-group statistics allow, and footer-only schema reads for discovery. It fits analytics pipelines and dashboards that aggregate many daily Parquet (or CSV) files.

Install

pip install snapparquet

From a checkout:

pip install -e .

Quick start

import snapparquet as sp

cols = ["user_id", "load_date", "revenue"]

df = sp.read_tabular(
    "metrics.parquet",
    columns=cols,
    filter_column="load_date",
    range_start=20250301,
    range_end=20250331,
)

# Many daily files
df = sp.read_tabular_many(
    ["day1.parquet", "day2.parquet"],
    columns=cols,
    filter_column="load_date",
    range_start=20250301,
    range_end=20250331,
)

API

Function Purpose
read_parquet(path, columns=..., filter_column=..., range_start=..., range_end=...) Parquet → pandas with pruning and optional range filter
read_csv(...) CSV with usecols + same range filter (in memory)
read_tabular(path, ...) Chooses Parquet vs CSV from the file suffix
read_tabular_many(paths, ...) Concatenate multiple files
read_parquet_many(paths, ...) Same as read_tabular_many (alias for Parquet-heavy workflows)
schema_column_names(path) Column set from Parquet metadata only
intersect_columns(path, wanted) Ordered intersection for columns=
column_is_integer_type(path, name) Whether range pushdown may apply
schema_matches_any_group(names, groups) Schema shape checks (e.g. alternate mart layouts)

Also exported: norm_col, schema_has_all.

When pushdown applies

If filter_column is stored as an integer type in the Parquet file, read_parquet / read_tabular try pyarrow.dataset first so row groups can be skipped using min/max statistics. Otherwise the same range filter runs in pandas after a (possibly pruned) read.

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

snapparquet-0.1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

snapparquet-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file snapparquet-0.1.2.tar.gz.

File metadata

  • Download URL: snapparquet-0.1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for snapparquet-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b1bd521a4fa71382de8cb5e44749aa2683e7b9a08cd5308bb2526280ae087d18
MD5 38285c5e6a8834743d4410522468ad5a
BLAKE2b-256 41f58d093f5d3986d70cef958c3a5d0f4cfd478551fd375922638b97696d776e

See more details on using hashes here.

File details

Details for the file snapparquet-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: snapparquet-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for snapparquet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c6a175209066bd1d5f30304abd9d8913d9d83dc79f7c212ebb4980dcf6750ee
MD5 5ec78fd8644a734d4f0ee03c12da4230
BLAKE2b-256 5fd14b71d68f1ce7f456ed5452277472063c5f792226c0129ae44711cdbda35c

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