parse parquet metadata including page headers
Project description
Parquet-Pages
read a parquet files' metadata information, including each individual data-page headers. Exposes them directly as thrift structs deserialised in accordance with parquet.thrift (included from apache/parquet-format) These structs include:
FileMetaDataRowGroup(s)ColumnChunk(s)ColumnMetaDataOffsetIndexColumnIndexPageHeader(s)
can refer to these directly as:
from parquet_pages import ttypes
ttypes.FileMetaData # etc
Everything except the PageHeader structs are in the file's footer. So if you don't need the PageHeaders, there are other simpler tools to get the rest.
Since this tool reads the PageHeaders too (which are scattered all over the file) it might end up doing significant I/O if the parquet file is large enough.
So it is really only intended for development-time inspection/debugging.
Usage Examples
from parquet_pages import read_parquet_metadata
metadata = read_parquet_metadata("example.parquet")
with open("example2.parquet", "rb") as file:
file_contents = file.read()
metadata2 = read_parquet_metadata(file_contents)
or invoke as as a module which displays it in an interactive TUI with collapsible sections.
optionally, can also instead dump repr(metadata) to stdout without any TUI, with readable indentation (--raw)
% python -m parquet_pages --help
usage: python -m parquet_pages [-h] -f FILEPATH [--expand] [--raw]
reads given parquet's FileMetaData and displays it in an interactive TUI with collapsible sections
options:
-h, --help show this help message and exit
-f, --filepath FILEPATH
Path to the parquet file
--expand [TUI only] expand all collapsible sections at start
--raw disable TUI and dump formatted repr directly to stdout
Requirements
Runtime
- Requires
thrift - Only optionally requires, but recommended:
textual- not optional during install, so would be installed automatically, but someone might uninstall it and core functionality will still work
parquet_pages.read_parquet_metadatadoes not require itpython -m parquet_pages --raw ...does not require it
- only to manage TUI display after metadata is read
- not optional during install, so would be installed automatically, but someone might uninstall it and core functionality will still work
Build-time
- Requires
thrift-compiler- but does NOT require this if installing from pypi
- see
Dockerfile,Makefile(make publish)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Third-Party Code
This project includes the file parquet.thrift from Apache Parquet Format, developed by the Apache Software Foundation.
That file is licensed under the Apache License, Version 2.0. See LICENSE-APACHE and NOTICE for details.
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
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 parquet_pages-0.4.0.tar.gz.
File metadata
- Download URL: parquet_pages-0.4.0.tar.gz
- Upload date:
- Size: 49.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ca2cd3d5659c5446ec9b75ab4514bcb1a2bb97e244e28de2b26758e73adb17
|
|
| MD5 |
dfbf3eb415402cab26a96124a1e6fec5
|
|
| BLAKE2b-256 |
f27d552a7cf61a780bc4513bf0cb1eadb100ab59f9e553f28548a4114341fd72
|
File details
Details for the file parquet_pages-0.4.0-py3-none-any.whl.
File metadata
- Download URL: parquet_pages-0.4.0-py3-none-any.whl
- Upload date:
- Size: 50.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a935d8c6abe597ee3e9d9587335fb3230c8027d577edc54f7eb15f3aa89f5c4c
|
|
| MD5 |
759e69ce0615570358ee2654aae82891
|
|
| BLAKE2b-256 |
45c80b99dd84c97f395448c58a7c7544c758c8bf42b31fe9cab531f69974e434
|