Skip to main content

Avro file reader/writer

Project description

Build Status

An Avro file reader/writer for Python.


>>> import pyavroc
>>> with open('myfile.avro') as fp:
>>>     reader = pyavroc.AvroFileReader(fp, types=True)
>>>     for record in reader:
>>>         print record

Comparison with original Avro Python API

pyavroc is a Python API on top of upstream Avro-C. This means it reads about 40 times faster than Avro’s Python implementation. (The exact timings depend on the version of Python used).



Relative speed (bigger is better)


Avro’s implementation (pure Python)



python-avro improved, using Cython



Python/C API on upstream Avro-C


Building the module

You will need to build Avro-C with a number of patches applied. This is available at, branch “patches”.

Then you can build pyavroc, linking against the Avro-C shared library.

The pyavroc repository contains the script which automates this process:


Writing records

pyavroc supports writing, both for records created as dictionaries, and for records created as Python objects.

More examples

More examples are available in the tests directory.


Copyright 2015 Byhiras (Europe) Limited

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details

Download files

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

Source Distribution

pyavroc-0.7.2.tar.gz (17.7 kB view hashes)

Uploaded source

Built Distributions

pyavroc-0.7.2-py3.5-linux-x86_64.egg (158.3 kB view hashes)

Uploaded 3 5

pyavroc-0.7.2-py3.4-linux-x86_64.egg (157.8 kB view hashes)

Uploaded 3 4

pyavroc-0.7.2-py2.7-linux-x86_64.egg (157.4 kB view hashes)

Uploaded 2 7

pyavroc-0.7.2-py2.6-linux-x86_64.egg (157.3 kB view hashes)

Uploaded 2 6

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