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.1

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

fastavro-1.5.1-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.1-cp310-cp310-macosx_10_14_x86_64.whl (493.8 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastavro-1.5.1-cp39-cp39-win_amd64.whl (435.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastavro-1.5.1-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.1-cp39-cp39-macosx_10_15_x86_64.whl (506.9 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

fastavro-1.5.1-cp38-cp38-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastavro-1.5.1-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.1-cp38-cp38-macosx_10_15_x86_64.whl (500.3 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

fastavro-1.5.1-cp37-cp37m-win_amd64.whl (421.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

fastavro-1.5.1-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.1-cp37-cp37m-macosx_10_15_x86_64.whl (490.6 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: fastavro-1.5.1.tar.gz
  • Upload date:
  • Size: 761.6 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.1.tar.gz
Algorithm Hash digest
SHA256 0815da740ced2261f90b0ddbb5bbe645e9c893c8f00e5dc8d30b8ec20f3c7fa9
MD5 af8c376907b7dd56a424327230106358
BLAKE2b-256 34275deb1f40c46c20655a4ba910de00a2507311134d7544526a94474d615377

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastavro-1.5.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 04438b592980633ccf5d1de7798480a634ca581ae7575ab7671ba16773b6b428
MD5 e1132feea8182e2b97180c5c003c2fa5
BLAKE2b-256 74744229c53abdde2838756942666c3281031f72ed3fc71d3140318dc8d5de3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b00b1711511981c4e2dd4a27ba5ae20897fe41ec7ab52eda868626d445081e5
MD5 26fd05b031f347b721907db2aa2c72d5
BLAKE2b-256 958a2adf6621c3eb856a94f7388080e90a321954ef7ea7b532b9292da689f930

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 920d170560198741fa196a62a97c220173339766e6c14369c5c68bfe8cdafa25
MD5 985f23e48c623dfc6b88e695b05cedf7
BLAKE2b-256 0269ebda2bae2baa8873a790e4c824863d061f04a31792f0b58e821f07ecc401

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastavro-1.5.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.4 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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fb3491c88e7962a6b820548ddd12b9c0f6296ebd2385a3021296f14bfe35189a
MD5 f47f81e116d03f202a581b5448e5bc2a
BLAKE2b-256 0f7309855bc1ade3b93ed275c3990cbcfe6edcd107cba79a3c845fbb7743183a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff241b5ce36df7af7461d001ca98fec6eacd56c4754c8ac7718e2d4b7b690a82
MD5 435df2da13ab1eb8316715a881971fe6
BLAKE2b-256 e780878c2257522aa2bd1d693d0349dfd3a4646391464142e9207cbe2502a828

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6b4f8551ccbe0c9b19867b8c93029e8cfe8fa3757245caae6228f35ef0656371
MD5 2a193f1a97c4915af19ee5dc76466f92
BLAKE2b-256 d0d06b7ae533034fd73842dc48febbd1b756904496842c6683f58ad5fc44fbde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastavro-1.5.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 435.2 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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0053347a92add6f448837ff00099b0a7200ec5dd58e173743d856d65d0574ddb
MD5 cfcd49031c76e9e215004c0351036365
BLAKE2b-256 6cfdd75b6348882dbf0e0e000567d9dbd29d26cdecec8e6abb8276b89c4ab2d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df83ebdd7b67b52a37bc84c6e25f7056f756fb216c5c8e5c95ae1673fcbb6015
MD5 5afc24f028ac712202b4d1f71e333fc4
BLAKE2b-256 7ebfc13b7ad6a0f942d9716561b8d2be04fe538d89a739f90585f4c41f0549b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0f1ed38042a2a90a7a5da170006459e73134f4c14f4fda9ebba99017adb1b14c
MD5 690717da92b83fd1adcf2511337b5397
BLAKE2b-256 1a1104c1d039ea8b0f67e10afa1b48b750339bcc4e4db998941936ebd8eae23b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastavro-1.5.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 421.3 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.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b5ff657c0d48553492d8356a30b6112fcc6db69adce6bba31135272bc9d87d82
MD5 0e5c5f91216e269b89061dd6508d00da
BLAKE2b-256 3b1282e6e0c7d59bd631143f5b6e14ad4fb1ec58c783c16d7cd38406385be832

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 84ca1a60cecd710ead076585b56b954ab3e6e001d8e7384cb4ed20019b29e7a9
MD5 2ccace73c3bcd208b49d6b8d46a68ed0
BLAKE2b-256 0f4785dc47120d7410333daf53a5be0f21273ef9f3dae0c4adfea45e8ff424f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.5.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0ab92ab744f9172da0791bfad0495d785c7c4f5a68924e3c6c6b39b78b044b11
MD5 3b3129afb43805fc3fcd7a1a0d65809b
BLAKE2b-256 e38af41d2406910a1c5f83dd10956bd6bde2faf731f4defc96ae326a47b77a22

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