Skip to main content

Fast read/write of AVRO files

Project description

# fastavro [![Build Status](https://travis-ci.org/tebeka/fastavro.svg?branch=master)](https://travis-ci.org/tebeka/fastavro) [![Documentation Status](https://readthedocs.org/projects/fastavro/badge/?version=latest)](http://fastavro.readthedocs.io/en/latest/?badge=latest) [![codecov](https://codecov.io/gh/tebeka/fastavro/branch/master/graph/badge.svg)](https://codecov.io/gh/tebeka/fastavro)

Because the Apache Python avro package is written in pure Python, it is relatively slow. In one test case, it takes about 14 seconds to iterate through a file of 10,000 records. By comparison, the JAVA avro SDK reads the same file in 1.9 seconds.

The fastavro library was written to offer performance comparable to the Java library. With regular CPython, fastavro uses C extensions which allow it to iterate the same 10,000 record file in 1.7 seconds. With PyPy, this drops to 1.5 seconds (to be fair, the JAVA benchmark is doing some extra JSON encoding/decoding).

fastavro supports the following Python versions:

  • Python 2.7

  • Python 3.4

  • Python 3.5

  • Python 3.6

  • PyPy

  • PyPy3

[Cython]: http://cython.org/

# Documentation

Documentation is available at http://fastavro.readthedocs.io/en/latest/

# Installing fastavro is available both on [PyPi](http://pypi.python.org/pypi)

pip install fastavro

and on [conda-forge](https://conda-forge.github.io) conda channel.

conda install -c conda-forge fastavro

# Contributing

  • Bugs and new feature requests typically start as github issues where they can be discussed. I try to resolve these as time affords, but PRs are welcome from all.

  • Get approval from discussing on the github issue before opening the pull request

  • Tests must be passing for pull request to be considered

Developer requirements can be installed with pip install -r developer_requirements.txt. If those are installed, you can run the tests with ./run-tests.sh. If you have trouble installing those dependencies, you can run docker build . to run the tests inside a docker container. This won’t test on all versions of python or on pypy, so it’s possible to still get CI failures after making a pull request, but we can work through those errors if/when they happen.

### Releasing

We release both to [pypi][pypi] and to [conda-forge][conda-forge].

We assume you have [twine][twine] installed and that you’ve created your own fork of [fastavro-feedstock][feedstock].

  • Make sure the tests pass

  • Run make tag

  • Copy the windows build artifacts for the new version from https://ci.appveyor.com/project/scottbelden/fastavro to the dist folder

  • Copy the linux build artifacts for the new version from https://github.com/tebeka/fastavro/releases/tag/ to the dist folder

  • Run make publish

  • Note the sha signature emitted at the above

  • Switch to feedstock directory and edit recipe/meta.yaml
    • Update version and sha256 variables at the top of the file

    • Run python recipe/test_recipe.py

    • Submit a [PR][pr]

[conda-forge]: https://conda-forge.org/ [feedstock]: https://github.com/conda-forge/fastavro-feedstock [pr]: https://conda-forge.org/#update_recipe [pypi]: https://pypi-hypernode.com/pypi [twine]: https://pypi-hypernode.com/pypi/twine

# Changes

See the [ChangeLog]

[ChangeLog]: https://github.com/tebeka/fastavro/blob/master/ChangeLog

# Contact

[Project Home](https://github.com/tebeka/fastavro)

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

fastavro-0.19.7.tar.gz (499.2 kB view details)

Uploaded Source

Built Distributions

fastavro-0.19.7-cp36-cp36m-win_amd64.whl (303.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

fastavro-0.19.7-cp36-cp36m-manylinux1_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.6m

fastavro-0.19.7-cp35-cp35m-win_amd64.whl (296.1 kB view details)

Uploaded CPython 3.5m Windows x86-64

fastavro-0.19.7-cp35-cp35m-manylinux1_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.5m

fastavro-0.19.7-cp34-cp34m-manylinux1_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.4m

fastavro-0.19.7-cp27-cp27m-win_amd64.whl (300.5 kB view details)

Uploaded CPython 2.7m Windows x86-64

fastavro-0.19.7-cp27-cp27m-manylinux1_x86_64.whl (1.2 MB view details)

Uploaded CPython 2.7m

File details

Details for the file fastavro-0.19.7.tar.gz.

File metadata

  • Download URL: fastavro-0.19.7.tar.gz
  • Upload date:
  • Size: 499.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fastavro-0.19.7.tar.gz
Algorithm Hash digest
SHA256 653b2d7ee327e6f03a19dd8e42b54c246af7c6d9c0a5055049daa5cd9dee73e4
MD5 a8465fb7e9cf58d40d4b8a21e4b7f14e
BLAKE2b-256 a70ab08ba5cef63c675e8442c2bf1cbcef90c8b9f824be2202d492f0cedb0913

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1e1109d0deb432353ed9f37dfda5e56e31eff54b3817382f8eb55ffe329d3809
MD5 6a0c5805963d87a45534fce14f877b19
BLAKE2b-256 6efab5a9ceaa207f8fdec90ba67eb579c6df5866933eadb26242b6b01fa7d6ff

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fb9f17d0c15401901b207d3185d84003f7418d782877ee5e4f7bb871a58b9960
MD5 767b924bcfbfa0a47586fe58b3eddc54
BLAKE2b-256 e1b75e05a6aa9320c37155e5c9404fa7f2b865d0649bcda7a40d09b2179668ab

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 47d99a99f2c3c7f639fb73afa1907f72ee1893628d09065351896f9f15706275
MD5 6a9ca6eb7d9abc293e75f5b73bd5e589
BLAKE2b-256 e987f9af3d35a65f3072ac9c0899aea01e7c1dcc8c0826caaafbf63e2db6186b

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 85dc6f7d44ac88758062b6b32e0babc4c3413b0dd6a5e19e368eddb1dc4b5de1
MD5 19363959f24843f37f8e9c2a89427693
BLAKE2b-256 7e581b74366af1c02b9dd85a848b23da3bdebb9a36f6824cbe4f8a4cb323e41c

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c2bf9da7c3ca6796a4c78f8b4205d08af67709603d53d79ae30dec6122484115
MD5 267a3484196608f34a891efcf5de7293
BLAKE2b-256 884106bb62e899df5bdf72f32168baa3b2a3238d0abebf246bcfe0e0d839a26f

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 9f132c0de913b06beae4697ec629b8bf679616fb49c294195de27a298f7c72a1
MD5 4a041347dd13fe790f7d8945c48735df
BLAKE2b-256 3eeb7d5e57b2b256acf19d3b098a39eca61cfa492c33fc27dd3b6eb9375e6f37

See more details on using hashes here.

File details

Details for the file fastavro-0.19.7-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-0.19.7-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a510f294b484fe80aab2b0f72f15ba29c289195120c13e766d872773e9006065
MD5 88926c087ff22436f82add212dac9479
BLAKE2b-256 425e37f6e1f4ec1606610463f5ebddeae44a99c598161702ca4a39458de65bf7

See more details on using hashes here.

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