Skip to main content

Fast read/write of AVRO files

Project description

fastavro

Build Status Documentation Status codecov

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 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10
  • PyPy3

Supported Features

  • File Writer
  • File Reader (iterating via records or blocks)
  • Schemaless Writer
  • Schemaless Reader
  • JSON Writer
  • JSON Reader
  • Codecs (Snappy, Deflate, Zstandard, Bzip2, LZ4, XZ)
  • Schema resolution
  • Aliases
  • Logical Types
  • Parsing schemas into the canonical form
  • Schema fingerprinting

Missing Features

  • Anything involving Avro's RPC features

Documentation

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

Installing

fastavro is available both on PyPI

pip install fastavro

and on conda-forge 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. .run-tests.sh only covers the Cython tests. In order to test the pure Python implementation, comment out python setup.py build_ext --inplace and re-run.

NOTE: Some tests might fail when running the tests locally. An example of this is this codec tests. If the supporting codec library is not availabe, the test will fail. These failures can be ignored since the tests will on pull requests and will be run in the correct environments with the correct dependecies set up.

Releasing

We release both to PyPI and to conda-forge.

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

  • Make sure the tests pass
  • Run make tag
  • Wait for all artifacts to be built and published the the Github release
  • Run make publish
  • The conda-forge PR should get created and merged automatically

Changes

See the ChangeLog

Contact

Project Home

Release history Release notifications | RSS feed

This version

1.5.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastavro-1.5.0.tar.gz (761.0 kB view details)

Uploaded Source

Built Distributions

fastavro-1.5.0-cp310-cp310-win_amd64.whl (425.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastavro-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fastavro-1.5.0-cp310-cp310-macosx_10_14_x86_64.whl (493.6 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastavro-1.5.0-cp39-cp39-win_amd64.whl (435.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastavro-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fastavro-1.5.0-cp39-cp39-macosx_10_15_x86_64.whl (506.3 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

fastavro-1.5.0-cp38-cp38-win_amd64.whl (434.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastavro-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fastavro-1.5.0-cp38-cp38-macosx_10_15_x86_64.whl (500.1 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

fastavro-1.5.0-cp37-cp37m-win_amd64.whl (421.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

fastavro-1.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

fastavro-1.5.0-cp37-cp37m-macosx_10_15_x86_64.whl (490.4 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: fastavro-1.5.0.tar.gz
  • Upload date:
  • Size: 761.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for fastavro-1.5.0.tar.gz
Algorithm Hash digest
SHA256 bea07403b0a6e476a110a766c89265200711c29fcd0afd448e02df956cf3fd3c
MD5 ed3130b4360263c7f5867d52ad834204
BLAKE2b-256 e8fd16c9bdd588f84ce2b29b404067f5b9acda23a3d4a93161c8a9221aff4c82

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: fastavro-1.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 425.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for fastavro-1.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fad930b9981156054c73025ee868692e56bff005e2eb48238c344fcc4dbe125f
MD5 51cd3804b43484dd9634d07bf5fb8b0e
BLAKE2b-256 9adc3a9f827f650e94a9e0df024ea26fb4995d883b2e5cffae9c34a52348242a

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7934f4c4d578bce88fecfb550ae80587bc17e7f56e5e46b63a3250e38efc2948
MD5 2a8338e3e39862ddefc7be7c8e7ba2eb
BLAKE2b-256 b730dc58366ff3f991e6f6fc61483608fa0446e92dcbc31f516172699571a46f

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9db7c52467a773542796597e7cca1dbb244749a00ca0c8c2931d3469268abd59
MD5 e1742fcc43fb8f1b3e5204ab5114c0e7
BLAKE2b-256 d13e414f822d174541074c62dc6d23d2436fb4285803142a2ea3858f3157356c

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fastavro-1.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for fastavro-1.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5f4b6e367e0fe9dc10350d02e208fd9258175f2ca03d6c87773665dd8bc75b76
MD5 0ecc9c900b5c6d52d4e7d70d1a03fbea
BLAKE2b-256 4c66793436581dbeb43515eb6a9996debfc93e9b727b319749fe37870dade943

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbb3b6750ef5e210ca0127bfb16110da015a243b23e67692e5d4fdd886df19d5
MD5 d5ea116ef5b8a038e855accdf45a04ba
BLAKE2b-256 d4db0bc1197e858783c525b3a7344a91387bd1ed012f8f490a295b77b230f352

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bbad1299763da33765b1db4d655f59df0c8d84376a4ef4daba7b5ad78c7b01f7
MD5 9f9163eabee11dcbd7fe2ba480e02b8e
BLAKE2b-256 f9da6237326c37696a9d3ec4ae4174dc25e23784e78a87cfdbf73c8317c6eb41

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fastavro-1.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 434.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for fastavro-1.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 952d24b4da3747facaeb98d607686bd4003e073dea1ad76a9cb97b603268837f
MD5 e176afef25c04f0a83dec05508b03d49
BLAKE2b-256 4f4769d05f7559542354d571e6799070301e2c7ab9c909c0a0a87e72f2aaafaf

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7578c82fefb8b803934a8cbb4ecca4c955e76eee9e280f87394ab10e967f1997
MD5 6d3ebcb31b452598ef4ff511349f4caf
BLAKE2b-256 ba6e9f4f26bd5c66c5805a4748df0e924b612a6670e22c2da336c57019aa3a1e

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 31b394a0c92e3b55e507cc05ac67fa3d6643a871d72b6bcbdfd5470101a3f04e
MD5 f2a7bdf1cf8e9b3d75f10b518b122c54
BLAKE2b-256 086fb383c95e335cac7afd9a782e3a060dabd6fb3a2c1735a190530385556fc6

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: fastavro-1.5.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 421.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for fastavro-1.5.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2ced94205a8b7471671e5e0f13dda5f0304c5e62c9a11d3fcbf0a6c868c2c714
MD5 383d1271f9331b5f1a0e4b8d053e96ba
BLAKE2b-256 1033470cfaed2a82b14c8f6e2ac86ad65345e944c7c6fd039e6907700cb59995

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb97ad0898be7b24528eb5b72c749276e4aa7904f19ac35ff3e2ef0e2d32abfa
MD5 1f937794e38bed4df87718bbf247c66e
BLAKE2b-256 2c99b218d410deb4235ec3e53fd59f0a6d0dbf2d9839ba570e61ce5c3b1b14ec

See more details on using hashes here.

File details

Details for the file fastavro-1.5.0-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for fastavro-1.5.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 890e1a39b61f19605ba7b65691546ec2718d0f9daa29c67365f9a4f76846daef
MD5 96fad3c90a6dad6b83d2699fbdacf25e
BLAKE2b-256 c81fb3e51098209101521e8a43cb807b1b24630e614c29e59f8f098eb0291095

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