tparquet (Python)
Read and write Parquet files that use PCODEC, a Parquet compression codec for numeric columns
(CompressionCodec 20547, see spec/FORMAT.md). Any Parquet file reads, PCODEC or not.
import tparquet as tpq
choice = tpq.write_table(table, "trades.parquet") # {"price": "PCODEC", "sym": "ZSTD", ...}
table = tpq.read_table("trades.parquet", columns=["ts", "price"])
stream = tpq.read_batches("trades.parquet") # __arrow_c_stream__, for any Arrow library
write_table(data, path, policy="auto", columns=None, level=8, base="zstd(3)", row_group_size=None, encodings=None):datais anything with__arrow_c_stream__or__arrow_c_array__;policyis"auto"(PCODEC or the base codec per column, whichever is smaller on the first batch),"pcodec"or"base",columnsmaps a column name or dotted leaf path to its own policy, andencodingsmaps one to the Parquet encoding of its base-codec pages ("ALP","BYTE_STREAM_SPLIT","DELTA_BINARY_PACKED"..., no dictionary; PCODEC columns stay PLAIN).Writer(path, schema, ...): a streaming context manager with the same options.ParquetFile(path):.schema,.metadata,.iter_batches(),.read().transcode,inspect,verify;tparquet.codecfor the page payload alone.tparquet.pandas:read_parquet,to_parquet(index and dtypes as with pyarrow).tparquet.polars:scan_parquet(projection, limit, predicate and row-group pruning pushed down),read_parquet,write_parquet.tparquet.duckdb:register,sql_view,read_parquet.
Paths are str, bytes or os.PathLike (names that are not UTF-8 work), or binary file objects
(a text-mode file is a TypeError; a file object to read from is read to its end once). Errors are
PcodecError (a ValueError) or the OSError of the failed I/O; read errors of a file opened from
a path start with the path. Readers without PCODEC support (pyarrow, Polars, DuckDB) fail on PCODEC
files instead of returning wrong data; transcode(..., target="standard") writes a copy they read.
- A
ParquetFilekeeps its file open (one descriptor, until it is garbage collected), so it reads the file whose footer it read even if the path is replaced or removed afterwards. - The options and the schema are checked before a path is created or truncated. A write that fails
(
write_table,transcode, aWriterthat is aborted or fails to close) removes the file it created;abort()does nothing once the writer is closed or aborted. - The data given to a
Writermust have the schema's column names, in order, as well as its types. baseis a codec as theparquetcrate names it (zstd(3),gzip(6),brotli(5),snappy,lz4,lz4_raw,uncompressed); PCODEC and LZO are not base codecs. Unions, and month-day-nano intervals, cannot be written. A dictionary of booleans is written, but theparquetcrate cannot read it back.- Integer options must be
ints of 64 bits (elseTypeErrororPcodecError), andcolumnsa sequence of names, not a string. tparquet.polars.scan_parquetapplies a limit before the predicate, as Polars meanshead(n).filter(p); it prunes row groups only on columns stored as Polars holds them (nottimestamp[s], which Polars reads in milliseconds).
The core needs no Python dependency; read_table and ParquetFile.read return pyarrow objects.
Install
From PyPI (wheels for Linux, macOS and Windows), with the extras for the libraries you use
(pyarrow, pandas, polars, duckdb):
python -m pip install "tparquet[pandas]"
INSTALL.md has uv, building from a checkout or from
GitHub, and other platforms.
Development
uv sync --python 3.14
uv run --no-sync maturin develop --uv
uv run --no-sync pytest # -m "not slow" skips the acceptance tests
uv run --no-sync ruff check src tests && uv run --no-sync mypy --strict
HYPOTHESIS_PROFILE=mutation TPARQUET_TESTDATA=$PWD/../testdata uv run --no-sync python scripts/mutmut_check.py
TPARQUET_PYTHON=$PWD/.venv/bin/python PYO3_PYTHON=$PWD/.venv/bin/python cargo mutants -p tparquet-python
Metadata
Release files for tparquet 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tparquet-1.0.0.tar.gz | 1.6 MB | Without provenance | Details for tparquet-1.0.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| tparquet-1.0.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for tparquet-1.0.0-cp310-abi3-win_amd64.whl |
| tparquet-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for tparquet-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| tparquet-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for tparquet-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| tparquet-1.0.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for tparquet-1.0.0-cp310-abi3-macosx_11_0_arm64.whl |
| tparquet-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for tparquet-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 22.9 MB
Release files / tparquet-1.0.0.tar.gz
| Download URL | tparquet-1.0.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa9503d71cc36598bd7af5c150b8caff7dd0c788e12e9c6c9a475e606121d710
|
|
BLAKE2b-256 checksum How to use checksums |
956c183a0babfb37d233acf4078d3a62dc0a1804f8c8310f7ae17b17208d0760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tparquet-1.0.0-cp310-abi3-win_amd64.whl
| Download URL | tparquet-1.0.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
744d1810f14aec6ef73b2b7871850eebf51dcc8dba0f4fecabf14e54db9c21ec
|
|
BLAKE2b-256 checksum How to use checksums |
91461190b9e241a3d528953a82d4d70cec2e839dff5be684fa0a2262cef64d3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tparquet-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | tparquet-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
08e464056fe5dfc4c9381d45e320c7624d7fc677703b94ea57cc3cbf224f6afa
|
|
BLAKE2b-256 checksum How to use checksums |
53f2115d3a91eca5936715290583c3b074165261b76a74893d3c9a06fa915ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tparquet-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | tparquet-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
96c7d60483c5e4759e97ff451e2493d8bcac1f374ec5e18978f40e5c662e26d4
|
|
BLAKE2b-256 checksum How to use checksums |
dc1adfe674da2058fd04c40ccb01690192bfd8b7ad45fd1645c0520d9311ab95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tparquet-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | tparquet-1.0.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2e2d7a1d4ef7ee0f1fc1d41f44216fc7a2471d99096b985e90f6fb1745489586
|
|
BLAKE2b-256 checksum How to use checksums |
86aceb7c7cb573a3c8954f608cf831bb06256c49b88adede9a3b0ec712529851
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tparquet-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | tparquet-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
021d4167dd4f666a8509eab3e3ea276b1ae57bf365d4920bff4b219277ba7c3f
|
|
BLAKE2b-256 checksum How to use checksums |
3335578938b56e72466101444e8ea4659397a905edd033ba61f0a3df6e3dd83f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for tparquet 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.