Edit page in Livemark
(2022-09-19 18:33)

Parquet Format

Frictionless supports reading and writing Parquet files.

pip install frictionless[parquet]
pip install 'frictionless[parquet]' # for zsh shell

Reading Data

You can read a Pandas dataframe:

from frictionless import Resource

resource = Resource('table.parq')
print(resource.read_rows())
[{'id': 1, 'name': 'english'}, {'id': 2, 'name': '中国人'}]

Writing Data

You can write a dataset to Pandas:

from frictionless import Resource

resource = Resource('table.csv')
target = resource.write('table-output.parq')
print(target)
print(target.read_rows())
{'name': 'table-output',
 'type': 'table',
 'path': 'table-output.parq',
 'scheme': 'file',
 'format': 'parq',
 'mediatype': 'appliction/parquet'}
[{'id': 1, 'name': 'english'}, {'id': 2, 'name': '中国人'}]

Reference

formats.ParquetControl (class)

formats.ParquetControl (class)

Json control representation

Signature

(*, title: Optional[str] = None, description: Optional[str] = None, columns: Optional[List[str]] = None, categories: Optional[Any] = None, filters: Optional[Any] = False) -> None

Parameters

  • title (Optional[str])
  • description (Optional[str])
  • columns (Optional[List[str]])
  • categories (Optional[Any])
  • filters (Optional[Any])

formats.parquetControl.columns (property)

NOTE: add docs

Signature

Optional[List[str]]

formats.parquetControl.categories (property)

NOTE: add docs

Signature

Optional[Any]

formats.parquetControl.filters (property)

NOTE: add docs

Signature

Optional[Any]

formats.parquetControl.to_python (method)

Convert to options

It's a beta version of Frictionless Framework (v5). Read Frictionless Framework (v4) docs for a version that is currently installed by default by pip.