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 FASTAVRO_USE_CYTHON=1 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

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

Uploaded Source

Built Distributions

fastavro-1.4.12-cp310-cp310-win_amd64.whl (424.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastavro-1.4.12-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.4.12-cp310-cp310-macosx_10_14_x86_64.whl (492.5 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastavro-1.4.12-cp39-cp39-win_amd64.whl (434.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastavro-1.4.12-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.4.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

fastavro-1.4.12-cp39-cp39-macosx_10_15_x86_64.whl (505.2 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

fastavro-1.4.12-cp38-cp38-win_amd64.whl (434.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastavro-1.4.12-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.4.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

fastavro-1.4.12-cp38-cp38-macosx_10_15_x86_64.whl (499.1 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

fastavro-1.4.12-cp37-cp37m-win_amd64.whl (420.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

fastavro-1.4.12-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.4.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

fastavro-1.4.12-cp37-cp37m-macosx_10_15_x86_64.whl (489.6 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fastavro-1.4.12.tar.gz
Algorithm Hash digest
SHA256 28c0d63eb286e64e9da79e083e299c33f1df65a490a1d79444dc453950daca40
MD5 d9c7045f8c92a9e2dc463e21729b2eb6
BLAKE2b-256 f5017fc170b850e176b6d29b94d24f0b083812ffb428f6bfcb613f81c8248c1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fee2240cff5a249458df604893abcc571efa178fa9b01f4ae0fa824295da3b54
MD5 5fdeb948c2fd61e693c1b6c9d6ad4b08
BLAKE2b-256 d97e9442a94e93fe2d0469249a920575dc955aca3d17c3fcc7c861eae9b4d2c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a38a954a45422fffedd1f65283b3ed8f32965a8399f545189d0b75e450407ff2
MD5 8f5ae7b0c2acb20e22fb3fcb9d8a8b6d
BLAKE2b-256 76f4e6b62038417664943dc335cf27dec624ebd2e1b054a390b7dd840990e3df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 97c47004fb7e6a1f38d729124e9607128577a15ee5a4d10c7f680251f1a4f204
MD5 6584c2ff138b3154512eb6c88e62dd28
BLAKE2b-256 e27ee3083ec8aa7cda39ad7d7d8b263b970543c4e3cb195d1d4d5e35b4b0e657

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastavro-1.4.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b289e4ed691f0fc5919ffc1c8d4bcb626055deaf75a5a2bca9015dc2367d95af
MD5 4b2cc82a27ee65bc2c0f515e69d40932
BLAKE2b-256 7e5ace158fb9a2cdce0ac6aa770ce79171f526dd04f8e38280f7d6b9f9731044

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fca5343950963545c1dd9db17e0451daf19fa50ac9e44313abd20e88cef3e48
MD5 50cbd43f69eace60ce433d45d2d7c92e
BLAKE2b-256 faa5dc590a84d6ddaca0d0cb922671a4423bd084fd8e2ac57eeb04fa92c5966a

See more details on using hashes here.

File details

Details for the file fastavro-1.4.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastavro-1.4.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 772527b59c4294f44f42328a4d2defe67a6db5f203f65257e698a1ff5b476a2f
MD5 4908562045070677e992b80e4b713dfa
BLAKE2b-256 23b3d2b9995071586ecc74af896fd757c80b0d1e9d728f12e51bdbfe82a5123c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1df7cd4248c0dbbd0c9be4643eb416f6e4f058211b6eaf4e15286813ab2a70ff
MD5 694d2c71420f52b5e071fdfe26961c91
BLAKE2b-256 f858e840c9965adcb44e3813355954fa8814d6f9564f451e9d12fe707b7d32c2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastavro-1.4.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3b04882e04192a64c06a8487a168e289f71cd31e51e1275bd34bb19d70669b48
MD5 963b60bb9a2c8fb667c92079d205477b
BLAKE2b-256 f8d396e45a4fe72bf93139326228d544fe27b064b00ebbb387e8c5c1216b5e44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e4b81c09346d6f47153b3c391e8f65bef0fc4dfd19b0e2bc7843f00e07ee1be
MD5 25125c7b7f2aabe3f133787b2f3b632e
BLAKE2b-256 9962db45807321bd85dbffc6b536bb143422aee348443f34721b1129618aedab

See more details on using hashes here.

File details

Details for the file fastavro-1.4.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastavro-1.4.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e88cc1f73421d3f60c21fa982fdb91411ac068506442d3a984a2b6ea400ae9dc
MD5 9f4efd4f205a61ad3442e2615835a56a
BLAKE2b-256 0643027ef1bcfb42b90cff36e9251f2b0160f81f557120a7bf35334adb215495

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7a8f273ac00f20adebfa394aea4219caf76844134ea21b53d393a1ae9a54f828
MD5 8f31d4a614c10414e548f5fb2cdb8155
BLAKE2b-256 3d21e78f73680c1930ddae67f97275d3aa5f726d219be2019f28a3f50d170673

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastavro-1.4.12-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e5888f81600c7cd62aeb9ed86b63d6e63dc9ad040b404c0ab42f4194f170d2b6
MD5 b79bfaff29a1e7ecbac9bb4f24600a29
BLAKE2b-256 c10c4bad02b72e129f598f5d6d74bb83ca501218fadfffc8709ce3692098165e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a9d418dbcba12e85ae1fd395d92917d592544b0dfe64db13ffebeb4959dd67f
MD5 d1fb393b13afe519b908df60da51b0c5
BLAKE2b-256 57077e42d0d402b49f7ae944f0a31190296af129b235bf8097143897d330c518

See more details on using hashes here.

File details

Details for the file fastavro-1.4.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fastavro-1.4.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6326d763939a2a9de560dd88035a9902660145745b6dda2060be5caee3d8e779
MD5 73305f2f307d30c96fa7373120fae27d
BLAKE2b-256 9dc856739263317498fc0e167f75bb370bdd7b8ed94f272638e03f9ac6fbf526

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastavro-1.4.12-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bc41b3495a34a17e17e77c7bc82ddaa5edaec82e103e763d0fb60cbb4d0efff0
MD5 d68303fcdae7e656cccf7969c57d886d
BLAKE2b-256 9d7ff952391b799acbdbc652b83e0a69b7a9343590503eb5fa88e4a35e6eff21

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