Fast read/write of AVRO files
Project description
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 3.8
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
- 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 available, 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 dependencies 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 details
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
Built Distributions
Hashes for fastavro-1.9.7-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6b2ccdc78f6afc18c52e403ee68c00478da12142815c1bd8a00973138a166d0 |
|
MD5 | 8d4c8c2be5b482c01af590cba4cc7bc8 |
|
BLAKE2b-256 | c80c92b468e4649e61eaa2d93a92e19a5b57a0f6cecaa236c53a76f3f72a4696 |
Hashes for fastavro-1.9.7-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee9bf23c157bd7dcc91ea2c700fa3bd924d9ec198bb428ff0b47fa37fe160659 |
|
MD5 | f1c5e97915518dedb042c3ad6597e0cd |
|
BLAKE2b-256 | 68dc66cc5227809074beb61cf19bfd615b5b1c0bce0d833af69a2d02b4408316 |
Hashes for fastavro-1.9.7-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d576eccfd60a18ffa028259500df67d338b93562c6700e10ef68bbd88e499731 |
|
MD5 | dd92a4546d44726a77414ab9a358775e |
|
BLAKE2b-256 | 851ad388306a809ad3b4820f1bd67b2fdd9dd9d0af8782dea6524bdb7fd249ef |
Hashes for fastavro-1.9.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be089be8c00f68e343bbc64ca6d9a13e5e5b0ba8aa52bcb231a762484fb270e |
|
MD5 | 274526ca6b3dade397b7c2536521ab21 |
|
BLAKE2b-256 | 694c011823812409d16c6785754c5332e3f551b8131ea14cf9dd14155a61baaf |
Hashes for fastavro-1.9.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac69666270a76a3a1d0444f39752061195e79e146271a568777048ffbd91a27 |
|
MD5 | 19a13debb2401246381567db46531dac |
|
BLAKE2b-256 | e029dd2f5b2213be103a6b22cbf62e1e17a8423aa687c05f37510688d7ed5987 |
Hashes for fastavro-1.9.7-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1289b731214a7315884c74b2ec058b6e84380ce9b18b8af5d387e64b18fc44 |
|
MD5 | 00cf247d57953f607e4fcdae9300f053 |
|
BLAKE2b-256 | bb30e6f13d07ca6b2ba42719192a36233d660d75bbdc91026a20da0e08f8d5f3 |
Hashes for fastavro-1.9.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db993ae6cdc63e25eadf9f93c9e8036f9b097a3e61d19dca42536dcc5c4d8b3 |
|
MD5 | b5ba826a48e6da03d3d2ec99f4ec4b5a |
|
BLAKE2b-256 | 43b3cac5151810a8c8b5ef318b488a61288fe07e623e9b342c3fc2f60cbfdede |
Hashes for fastavro-1.9.7-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d09227d1f48f13281bd5ceac958650805aef9a4ef4f95810128c1f9be1df736 |
|
MD5 | b1605d7dca7cea54e42068212e106a69 |
|
BLAKE2b-256 | b27e21b3066973c60309f8e58f3d0d63dfdad196354217416384577c1e8faee0 |
Hashes for fastavro-1.9.7-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9de1fa832a4d9016724cd6facab8034dc90d820b71a5d57c7e9830ffe90f31e4 |
|
MD5 | 56489477538179516951d7c59ef8f4c9 |
|
BLAKE2b-256 | 600862707fe5bfb7c4dca99132c969b38270579bf96408552a0baf201e861e84 |
Hashes for fastavro-1.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919f3549e07a8a8645a2146f23905955c35264ac809f6c2ac18142bc5b9b6022 |
|
MD5 | 8c6372343f6af4d69abab4a854465d6c |
|
BLAKE2b-256 | 682b0015355fb7dbf31dee0f3e69e6fa1ff43967500a8b1abb81de5a15f24b16 |
Hashes for fastavro-1.9.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76d9d96f98052615ab465c63ba8b76ed59baf2e3341b7b169058db104cbe2aa0 |
|
MD5 | c3d7a9671b707a506161997b4bc7447e |
|
BLAKE2b-256 | a0a1c6539ac9f6e068c1920f5d6a823113cd60088160050ed32ee4e7b960c1aa |
Hashes for fastavro-1.9.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec8499dc276c2d2ef0a68c0f1ad11782b2b956a921790a36bf4c18df2b8d4020 |
|
MD5 | cd3f87887780d0d54d8fa7e1b58c3a92 |
|
BLAKE2b-256 | 8961b8b18aebc01e5d5a77042f6d555fe091d3279242edd5639252c9fcb9a3b7 |
Hashes for fastavro-1.9.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6312fa99deecc319820216b5e1b1bd2d7ebb7d6f221373c74acfddaee64e8e60 |
|
MD5 | 73ab77b7cc859790045818f257f1d599 |
|
BLAKE2b-256 | 7254d73fd1e91385f45e04168c5660ee5f18222ed644d52f0271207d3e7807b5 |
Hashes for fastavro-1.9.7-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b525c363e267ed11810aaad8fbdbd1c3bd8837d05f7360977d72a65ab8c6e1fa |
|
MD5 | 035dc39380967d1613d98c1eba7e6df2 |
|
BLAKE2b-256 | 5689f37e824942867771027f1e2e297b3d1f0ee2e72f8faae610d5f863258df3 |
Hashes for fastavro-1.9.7-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87d04b235b29f7774d226b120da2ca4e60b9e6fdf6747daef7f13f218b3517a |
|
MD5 | 09d041c9d80190e5449cc2ae021b2d2a |
|
BLAKE2b-256 | ed49d667623c67351cfd884f8643edcde8e75210988648b53253d082ef4e5bb9 |
Hashes for fastavro-1.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2f9bafa167cb4d1c3dd17565cb5bf3d8c0759e42620280d1760f1e778e07fc |
|
MD5 | 08d456fb41be50fdc978dd96236e62e4 |
|
BLAKE2b-256 | 3f5ce9d528770af9c1cb38611e6b9a8976dfb822a876cbe5d0c9801988d56d1c |
Hashes for fastavro-1.9.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb8749e419a85f251bf1ac87d463311874972554d25d4a0b19f6bdc56036d7cf |
|
MD5 | 42ff17ee2a0bf63d1d47c055022f5df1 |
|
BLAKE2b-256 | 36f8854fa8c91c0e8a4f7aa26711e0a8e52d1eb408066a3c56fe0746402b06df |
Hashes for fastavro-1.9.7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc811fb4f7b5ae95f969cda910241ceacf82e53014c7c7224df6f6e0ca97f52f |
|
MD5 | e58e850892570e76d9a82d2223dae3ea |
|
BLAKE2b-256 | 79240e9940a19aea0599987807f261d9ae66a9c180e6f14464b2b738b06cc48f |
Hashes for fastavro-1.9.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 912283ed48578a103f523817fdf0c19b1755cea9b4a6387b73c79ecb8f8f84fc |
|
MD5 | 6c0830c15d7d93f325151c5268af21ed |
|
BLAKE2b-256 | c52061dae2c2725824fb26c16f1ceb955b915e3b295b52dde30c61f8ade7c7e3 |
Hashes for fastavro-1.9.7-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c911366c625d0a997eafe0aa83ffbc6fd00d8fd4543cb39a97c6f3b8120ea87 |
|
MD5 | f5b89c5fb346ab79af2848a904ae071f |
|
BLAKE2b-256 | 965691265af4da9007fd72480f2ac6b1912359e892ed90990996adc01e734b5b |
Hashes for fastavro-1.9.7-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17de68aae8c2525f5631d80f2b447a53395cdc49134f51b0329a5497277fc2d2 |
|
MD5 | 931f01da250ee833689ad1b9ad0ca809 |
|
BLAKE2b-256 | 393bcba99b9609ed27906188acd752368d53579682d8e54622c064eb14f8f7a8 |
Hashes for fastavro-1.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fcce036c6aa06269fc6a0428050fcb6255189997f5e1a728fc461e8b9d3e26b |
|
MD5 | e68d6440b9c696f34f0e7716649acbb5 |
|
BLAKE2b-256 | 2b440f3c16daac4f20aa2689075b341590166adc9f2fc4ce2c87818e20b1a202 |
Hashes for fastavro-1.9.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56304401d2f4f69f5b498bdd1552c13ef9a644d522d5de0dc1d789cf82f47f73 |
|
MD5 | d007a17130dd27975a5752bb366f0db5 |
|
BLAKE2b-256 | 93b3298f1c4797e64989cee288865cb95310960737468565697b31427f593acf |
Hashes for fastavro-1.9.7-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58f76a5c9a312fbd37b84e49d08eb23094d36e10d43bc5df5187bc04af463feb |
|
MD5 | 7463942d5b1a5a3f1d4bf8246e362fa1 |
|
BLAKE2b-256 | f013571f9890263207cb03c4fe055f74362bcc94f165128fca9fbace6d431b5a |
Hashes for fastavro-1.9.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b683693c8a85ede496ebebe115be5d7870c150986e34a0442a20d88d7771224 |
|
MD5 | 61b961daff0a6db12685449a1f2af2df |
|
BLAKE2b-256 | c43691bea71da59da904d18a8df84b01ed1eb6c0680c87b94cc78bc4581d10aa |
Hashes for fastavro-1.9.7-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec2e96bdabd58427fe683329b3d79f42c7b4f4ff6b3644664a345a655ac2c0a1 |
|
MD5 | 9b2bc918676cc63ad8a8a41083615f7b |
|
BLAKE2b-256 | 5be842a105a4842115232a5a1326645f045daa49961c0b3a1812bb67967f4897 |
Hashes for fastavro-1.9.7-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc28ab305e3c424de5ac5eb87b48d1e07eddb6aa08ef5948fcda33cc4d995ce |
|
MD5 | ff1c9adc25e922a37778f3f4e3e67024 |
|
BLAKE2b-256 | bda514119c0bf73e9a2d0ee2d875e811e83994732f3b81f42582db5288ea040b |
Hashes for fastavro-1.9.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2af559f30383b79cf7d020a6b644c42ffaed3595f775fe8f3d7f80b1c43dfdc5 |
|
MD5 | 74760917eeab61eeddb6473a1febc2f8 |
|
BLAKE2b-256 | 3a6a1998c619c6e59a35d0a5df49681f0cdfb6dbbeabb0d24d26e938143c655f |
Hashes for fastavro-1.9.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 536f5644737ad21d18af97d909dba099b9e7118c237be7e4bd087c7abde7e4f0 |
|
MD5 | e2c7806edf17053c7adc81d0d2bf5050 |
|
BLAKE2b-256 | fff6d106d0e6d4ea96aa138e548a70f6eceeed45d717eaac10a86c362eb53e28 |
Hashes for fastavro-1.9.7-cp38-cp38-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7313def3aea3dacface0a8b83f6d66e49a311149aa925c89184a06c1ef99785d |
|
MD5 | de9b60bb32d886a74e510a1728b19391 |
|
BLAKE2b-256 | 899ecb4f6852f4efa1cf0a02fbc1867da78393d5e82b869605b3ef0eeaca031b |