Skip to main content

Python support for Parquet file format

Project description

https://travis-ci.org/jcrobak/parquet-python.svg?branch=master

fastparquet is a python implementation of the parquet format, aiming integrate into python-based big data work-flows.

Not all parts of the parquet-format have been implemented yet or tested e.g. see the Todos linked below. With that said, fastparquet is capable of reading all the data files from the parquet-compatability project.

Introduction

This software is alpha, expect frequent API changes and breakages.

A list of expected features and their status in this branch can be found in this issue, and further Please feel free to comment on that list as to missing items and priorities.

In the meantime, the more eyes on this code, the more example files and the more use cases the better.

Requirements

(all development is against recent versions in the default anaconda channels)

Required:

  • numba

  • numpy

  • pandas

  • cython

  • six

Optional (compression algorithms; gzip is always available):

  • snappy (aka python-snappy)

  • lzo

  • brotli

Installation

Install using conda:

conda install -c conda-forge fastparquet

install from pypi:

pip install fastparquet

or install latest version from github:

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

For the pip methods, numba must have been previously installed (using conda).

Usage

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

Since early October 2016, this fork of parquet-python has been undergoing considerable redevelopment. The aim is to have a small and simple and performant library for reading and writing the parquet format from python.

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-0.0.5.tar.gz (105.1 kB view details)

Uploaded Source

Built Distribution

fastparquet-0.0.5-cp35-cp35m-macosx_10_6_x86_64.whl (129.6 kB view details)

Uploaded CPython 3.5m macOS 10.6+ x86-64

File details

Details for the file fastparquet-0.0.5.tar.gz.

File metadata

  • Download URL: fastparquet-0.0.5.tar.gz
  • Upload date:
  • Size: 105.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fastparquet-0.0.5.tar.gz
Algorithm Hash digest
SHA256 38d003fda383f7d90005011e926a75909c9d804a31c7fc943600d25c1b5762c3
MD5 4aa6cac07dcda2ca92a9e9877a9f3902
BLAKE2b-256 76926bb8963e423c9e276dde943fc7cfc2225d4eda13d495e73e2f5ad087cfb2

See more details on using hashes here.

Provenance

File details

Details for the file fastparquet-0.0.5-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

File hashes

Hashes for fastparquet-0.0.5-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 f92cacc5eea6c2ece14890bdbb4ef82b666961eebe3d8b8eed889cc55b1059f4
MD5 98545f9fecbc542739db81f30524e2f2
BLAKE2b-256 2649f5aa224498b4e486aa7112c4415ee609ae4dfc2afe2a77f8d485ff3750ef

See more details on using hashes here.

Provenance

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