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 2.7
- Python 3.5
- Python 3.6
- Python 3.7
- Python 3.8
- PyPy
- 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
Missing Features
- Anything involving Avro's RPC features
- Parsing schemas into the canonical form
- Schema fingerprinting
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
- 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/fastavro/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
andsha256
variables at the top of the file - Run
python recipe/test_recipe.py
- Submit a PR
- Update
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-0.23.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65db58b7d295304c51d55e8ba95d4c6cbb6d1afc81acc8f41dc9491fc3a0be4 |
|
MD5 | a050374b0230edd2fda48420592e8d03 |
|
BLAKE2b-256 | 2d1b29329cbdaaa9fbd00454b3b1de19b2f9a403108d96a8d1efaeee6649290a |
Hashes for fastavro-0.23.5-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e32736413341cebaa548bf6b30e26a99925212a87dd936c53c108f558cf3d19 |
|
MD5 | 0c2ec60af384621240ae83083b9ffa6b |
|
BLAKE2b-256 | da4cbaabc1f2feff27b46cc94552d6992f9b768c4b02f7dfb8045c529071dbf3 |
Hashes for fastavro-0.23.5-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc7d1bc3fa4d3cc586ef1981749ed3d7d9be38401662a9c54e9912d343ee7f67 |
|
MD5 | 64269b500a5192e4c3fc8baf5dab393a |
|
BLAKE2b-256 | 91183d9248d2235424143dbdf46e9e63c2e8241cb84f2fcb278f0ecaac22aade |
Hashes for fastavro-0.23.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15f1b00a996610dec2f587a896175a21913c83a037c3f419bde9b15c32feca78 |
|
MD5 | cac4228e68f361c02a27526398f86863 |
|
BLAKE2b-256 | f3eaba470342c8787e9a5b402d301a98f5637a71377a814d2ad5e45f175df79e |
Hashes for fastavro-0.23.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2785002f551956582481c7a2432d7418f82cda328e5b3730750016d69352a3dc |
|
MD5 | c2c4255dcd22daf5fba0371c4d1b3156 |
|
BLAKE2b-256 | 3e299bf62e404959566736bb08ac1a89a404f795208c669377bd3343548ea531 |
Hashes for fastavro-0.23.5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5de4f0d309de9119de98edbf807ff4fe13c033629a7c9e771611a7e3bb8cc31 |
|
MD5 | 444eb1567e487e3e64c56f83ec679512 |
|
BLAKE2b-256 | a850cd6bd1773279d0897b65df321a2b49bba0039f80d66350768b3622902a93 |
Hashes for fastavro-0.23.5-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf3f41ca6d611b72f50018263f8ea341f69118d26eebb92893e5de45c9b309d |
|
MD5 | 45dab23d4ec3c7d20367eca591100ff5 |
|
BLAKE2b-256 | 89c93ea6674377b684a99fdd9529764bbf09bb58234fa751c5aee10bc6b56263 |
Hashes for fastavro-0.23.5-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f32c1f4a5484ae2aed38f7e502ca7451303c97453bc925c065558483d053866a |
|
MD5 | 2722981af9ac7a0adde51c41b077b203 |
|
BLAKE2b-256 | c67647c13b68e0240abe4f6a23e8aa77d87d900afbf0c0cc2fd13e71f101078e |
Hashes for fastavro-0.23.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9257570c4fe088e1610b8f5779dc79622d32f0151dc018594a0cf7219ad744bb |
|
MD5 | f55088e3409f3b8c917ec2b21a6521b6 |
|
BLAKE2b-256 | 733b9985d807746bd8f0f4979f7c3a1dfe2413c6bf7be5f14795dcd39c2f1aa2 |
Hashes for fastavro-0.23.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24370f1a0debcd87b113bc73a16d3949d8396c7143a4cd74e4384360d264e29 |
|
MD5 | 54c4e27d96a5e8ce1ad9628ec4c3fa50 |
|
BLAKE2b-256 | b1c9afa4cf67cef2668affbcaa095ab1e2eb6ec65b9938efe2ee495c70a567bc |
Hashes for fastavro-0.23.5-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b805e7b0e6111aea8a9ddaf9ae181ddcc382c78b1e338513b67b395dd2a4099b |
|
MD5 | be0851ae6a69a0253ea9247a9e281751 |
|
BLAKE2b-256 | 49c954742221a5815b11d258f1e7d41da6348f23033bc0d7c6a069a4f9377ffc |
Hashes for fastavro-0.23.5-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f23d297e37901edf2b41df50a9005f04f65a0351c683c0aee38f406b25569ce5 |
|
MD5 | b2a36012ccb293356a61b5ee23d13721 |
|
BLAKE2b-256 | 65bcb71659e091eb9dfe5caade4d166acecf71f98abdc2ccec5c2703def8cce5 |
Hashes for fastavro-0.23.5-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf02ee23ed0d1b99ae2326a44332245d1fb3ec0f601fe38e3211c975d3341d5b |
|
MD5 | a333dbc105c5602f7c87fa2d5b469528 |
|
BLAKE2b-256 | e79bb0b9b88e4e0753d5579f8096ed1b3f03f3807ea1b8692243e7d00d6c65b4 |
Hashes for fastavro-0.23.5-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ca20e168e3875a2dc349ab77dbe32e8b60bf1b72f2feac06761a17d3891160b |
|
MD5 | 813b16a37da5d173ad887c17229a236b |
|
BLAKE2b-256 | b3305d27241edde114e95196ef0dcf57969bcb5337555eb9f91d2fcdeb6d5ba4 |
Hashes for fastavro-0.23.5-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4fe936709411551725644bc793fa050bd70657f2c128b8feae056c958b42e7f |
|
MD5 | edbdbac98ae250cb95f470a803bc902a |
|
BLAKE2b-256 | ee308364039ef075af7221b9981b147f4685748a4800b675e9e259b08f8188d2 |
Hashes for fastavro-0.23.5-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f211e0d76973b5130f98509edd68d943f016a4b958af9a3eaeabfdb969b0ef8 |
|
MD5 | 1e68b7de68018ec78edce0bbfbfac6b2 |
|
BLAKE2b-256 | be854954956c688816b928ed65465a1c0070517490936b4c0d8a4e6a79da0ebf |
Hashes for fastavro-0.23.5-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0239620e78022b03d835ea4441f101786037ffc8658c6f6a6c5a0b42acea951 |
|
MD5 | b126fcdfdcd6c8eadab92afdfbd4c2d0 |
|
BLAKE2b-256 | 23290f9a7f83dc5dab9877e09c10e39a8075752c3c07058e0d48316d86e4be30 |
Hashes for fastavro-0.23.5-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c6928b66c2812c35ec211aae399bbc8d240b85867deef4b54ea96d0875ada45 |
|
MD5 | 73986323d9720eb7ecac1e0567e719b2 |
|
BLAKE2b-256 | fc3d53f360c48cc30b1b90085efab40c09baa5a492c5aa002cd3a7ad702ce3a3 |
Hashes for fastavro-0.23.5-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 932d44bf1dbda73992c26a9d508df6a1d8fff44164aad7bead80384e2d066903 |
|
MD5 | 6a890dc15266ae9cb98816b19689b6c0 |
|
BLAKE2b-256 | 68dbee187355356a806666a87822e2cdbf5afb04f4783397282eecddf653893d |
Hashes for fastavro-0.23.5-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5741d0f9724dd5202999b86b679ec02df1598332f73d1508772a9e440c9c3db7 |
|
MD5 | ae39d312dff9eba60c6fe1782114c8a2 |
|
BLAKE2b-256 | e621603d4593030c04449846ffb9e550a8ede9be495509676a998f6487fba62a |
Hashes for fastavro-0.23.5-cp27-cp27m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30b81cdefb16a8fbc422454bc9bbb62a12e0632515cc0c1543db8de5b8aa2712 |
|
MD5 | 633bfb371b21871b93de26396bad53d7 |
|
BLAKE2b-256 | c7f2ec6ffa810e105752c45910bddcd752f753d4af5f13c2bc78048d0110d16d |