Skip to main content

Python support for Parquet file format

Project description

https://github.com/dask/fastparquet/actions/workflows/main.yaml/badge.svg https://readthedocs.org/projects/fastparquet/badge/?version=latest

fastparquet is a python implementation of the parquet format, aiming integrate into python-based big data work-flows. It is used implicitly by the projects Dask, Pandas and intake-parquet.

We offer a high degree of support for the features of the parquet format, and very competitive performance, in a small install size and codebase.

Details of this project, how to use it and comparisons to other work can be found in the documentation.

Requirements

(all development is against recent versions in the default anaconda channels and/or conda-forge)

Required:

  • numpy

  • pandas

  • cython >= 0.29.23 (if building from pyx files)

  • cramjam

  • fsspec

Supported compression algorithms:

  • Available by default:

    • gzip

    • snappy

    • brotli

    • lz4

    • zstandard

  • Optionally supported

Installation

Install using conda, to get the latest compiled version:

conda install -c conda-forge fastparquet

or install from PyPI:

pip install fastparquet

You may wish to install numpy first, to help pip’s resolver. This may install an appropriate wheel, or compile from source. For the latter, you will need a suitable C compiler toolchain on your system.

You can also install latest version from github:

pip install git+https://github.com/dask/fastparquet

in which case you should also have cython to be able to rebuild the C files.

Usage

Please refer to the documentation.

Reading

from fastparquet import ParquetFile
pf = ParquetFile('myfile.parq')
df = pf.to_pandas()
df2 = pf.to_pandas(['col1', 'col2'], categories=['col1'])

You may specify which columns to load, which of those to keep as categoricals (if the data uses dictionary encoding). The file-path can be a single file, a metadata file pointing to other data files, or a directory (tree) containing data files. The latter is what is typically output by hive/spark.

Writing

from fastparquet import write
write('outfile.parq', df)
write('outfile2.parq', df, row_group_offsets=[0, 10000, 20000],
      compression='GZIP', file_scheme='hive')

The default is to produce a single output file with a single row-group (i.e., logical segment) and no compression. At the moment, only simple data-types and plain encoding are supported, so expect performance to be similar to numpy.savez.

History

This project forked in October 2016 from parquet-python, which was not designed for vectorised loading of big data or parallel access.

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

fastparquet-2024.2.0.tar.gz (465.1 kB view hashes)

Uploaded Source

Built Distributions

fastparquet-2024.2.0-cp312-cp312-win_amd64.whl (669.7 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

fastparquet-2024.2.0-cp312-cp312-musllinux_1_1_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

fastparquet-2024.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

fastparquet-2024.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

fastparquet-2024.2.0-cp312-cp312-macosx_11_0_arm64.whl (687.8 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

fastparquet-2024.2.0-cp312-cp312-macosx_10_9_universal2.whl (920.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

fastparquet-2024.2.0-cp311-cp311-win_amd64.whl (670.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

fastparquet-2024.2.0-cp311-cp311-musllinux_1_1_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

fastparquet-2024.2.0-cp311-cp311-musllinux_1_1_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

fastparquet-2024.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fastparquet-2024.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

fastparquet-2024.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

fastparquet-2024.2.0-cp311-cp311-macosx_11_0_arm64.whl (684.9 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fastparquet-2024.2.0-cp311-cp311-macosx_10_9_universal2.whl (913.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

fastparquet-2024.2.0-cp310-cp310-win_amd64.whl (670.4 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fastparquet-2024.2.0-cp310-cp310-musllinux_1_1_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

fastparquet-2024.2.0-cp310-cp310-musllinux_1_1_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

fastparquet-2024.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fastparquet-2024.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

fastparquet-2024.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

fastparquet-2024.2.0-cp310-cp310-macosx_11_0_arm64.whl (685.3 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fastparquet-2024.2.0-cp310-cp310-macosx_10_9_universal2.whl (914.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

fastparquet-2024.2.0-cp39-cp39-win_amd64.whl (670.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fastparquet-2024.2.0-cp39-cp39-musllinux_1_1_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

fastparquet-2024.2.0-cp39-cp39-musllinux_1_1_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

fastparquet-2024.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fastparquet-2024.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

fastparquet-2024.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

fastparquet-2024.2.0-cp39-cp39-macosx_11_0_arm64.whl (685.3 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fastparquet-2024.2.0-cp39-cp39-macosx_10_9_universal2.whl (915.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

fastparquet-2024.2.0-cp38-cp38-win_amd64.whl (671.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

fastparquet-2024.2.0-cp38-cp38-musllinux_1_1_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

fastparquet-2024.2.0-cp38-cp38-musllinux_1_1_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

fastparquet-2024.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fastparquet-2024.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

fastparquet-2024.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

fastparquet-2024.2.0-cp38-cp38-macosx_11_0_arm64.whl (685.1 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fastparquet-2024.2.0-cp38-cp38-macosx_10_9_universal2.whl (914.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page