Skip to main content

Fast column-pruned Parquet reads with optional predicate pushdown for analytics.

Project description

snapparquet

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.

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
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)

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.

Publishing to PyPI

Follow the PyPA packaging tutorial: use TestPyPI first, then production PyPI.

  1. Register at pypi.org and create an API token under Account settings → API tokens.
  2. Confirm the project name is available: pip index versions snapparquet
  3. From this directory:
python3 -m pip install --upgrade pip build twine
python3 -m build
python3 -m twine check dist/*
  1. TestPyPI (recommended first upload):
python3 -m twine upload --repository testpypi dist/*
  1. Production PyPI (omit --repository; default is pypi.org):
python3 -m twine upload dist/*

Use username __token__ and password = your token (including the pypi- prefix), or set TWINE_USERNAME=__token__ and TWINE_PASSWORD.

After publishing, set Repository / Issues in [project.urls] in pyproject.toml to your real Git host.

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

snapparquet-0.1.1.tar.gz (8.7 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.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snapparquet-0.1.1.tar.gz
  • Upload date:
  • Size: 8.7 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.1.tar.gz
Algorithm Hash digest
SHA256 ef22a218f4361e4d9483836c1fb906c6f2df1be1e4924d0fcfa4ae7cfd0422d1
MD5 fcc13b14ebbf8f04b3ac82c7f308b26c
BLAKE2b-256 9582a15ee8c18bad029098115fc5ec8080fc475679a2bdfde5dc77ce0b47424d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snapparquet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17fd909197aa98f2414613f00c479ff603b912bc92e5d3f962e85d578e5953ac
MD5 44dbcf2f0235f8c36f762fb96f8e5bc5
BLAKE2b-256 b6e146b0c2b66bc7af01756d6f1bf03822e45a3f6d414ec5fcd5e66272d4d471

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