Getting Started

This package is available from the Python Package Index. If you have pip you should be able to do:

$ pip install petl

You can also download manually, extract and run python install.

To verify the installation, the test suite can be run with pytest, e.g.:

$ pip install pytest
$ pytest -v petl

petl has been tested with Python versions 2.7 and 3.4-3.6 under Linux and Windows operating systems.

Dependencies and extensions

This package is written in pure Python and has no installation requirements other than the Python core modules.

Some domain-specific and/or experimental extensions to petl are available from the petlx package.

Some of the functions in this package require installation of third party packages. These packages are indicated in the relevant parts of the documentation for each file format.

Also is possible to install some of dependencies when installing petl by specifying optional extra features, e.g.:

$ pip install petl['avro', 'interval', 'remote']

The available extra features are:


For using records from Databases with SQLAlchemy.

Note that is also required installing the package for the desired database.

For using Interval transformations with intervaltree
For using Avro files with fastavro
For using DataFrames with pandas
For using Arrays with numpy
For using Excel/LO files with xlrd/xlwt
For using Excel/LO files with openpyxl
For using XPath expressions with lxml
For using Bcolz ctables with bcolz
For using Text indexes with whoosh

For using HDF5 files with PyTables.

Note that also are additional software to be installed.


For reading and writing from Remote Sources with fsspec.

Note that fsspec also depends on other packages for providing support for each protocol as described in