Skip to main content

Avro file reader/writer

Project description

pyavroc
=======

An Avro file reader/writer for Python.

Usage
-----

```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).

Name | Description | Relative speed (bigger is better)
--------------------------------------------------|-------------------------------------|----------------------------------
[python-avro](https://github.com/apache/avro.git) | Avro's implementation (pure Python) | 1
[fastavro](https://bitbucket.org/tebeka/fastavro) | python-avro improved, using Cython | 10
[pyavroc](https://github.com/Byhiras/pyavroc.git) | Python/C API on upstream Avro-C | 40

Building the module
-------------------

You will need to build Avro-C with a number of patches applied. This is available at https://github.com/Byhiras/avro.git, branch "patches".

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

The pyavroc repository contains the script `clone_avro_and_build.sh` which automates this process:

```bash
./clone_avro_and_build.sh
```

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.

License
-------

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:

http://www.apache.org/licenses/LICENSE-2.0

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyavroc-0.6.1-py3.4-linux-x86_64.egg (157.6 kB view details)

Uploaded Egg

pyavroc-0.6.1-py2.7-linux-x86_64.egg (157.2 kB view details)

Uploaded Egg

pyavroc-0.6.1-py2.6-linux-x86_64.egg (157.2 kB view details)

Uploaded Egg

File details

Details for the file pyavroc-0.6.1.tar.gz.

File metadata

  • Download URL: pyavroc-0.6.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyavroc-0.6.1.tar.gz
Algorithm Hash digest
SHA256 918e8a5610b4bce14d734f264fafdcc0140a646620c4c218ba918f4730f9b9e2
MD5 310364b171334c825d268ea6717455b0
BLAKE2b-256 81d55375b631622a365cf0bfc8cbb940d043d1b978bcce63d82b5b7e7be2ccc3

See more details on using hashes here.

File details

Details for the file pyavroc-0.6.1-py3.4-linux-x86_64.egg.

File metadata

File hashes

Hashes for pyavroc-0.6.1-py3.4-linux-x86_64.egg
Algorithm Hash digest
SHA256 e1ef5b9b583b6e01348212e4ba784c3cafe94754e21a80b611e5375a1e84a8db
MD5 c19cf6beaf10f95b44b72d6b314b6946
BLAKE2b-256 a074fca83e400736880d4fffb05e748502ef82e7e5bc5bcb0a5ed14a26693d4e

See more details on using hashes here.

File details

Details for the file pyavroc-0.6.1-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for pyavroc-0.6.1-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 2c75387983fe5e0b6152433b18957fca1ff7c551356fed335fadd1b5405b57a5
MD5 82228719faeed00bfdc17b2a9816b082
BLAKE2b-256 d3aab7584059853946bc7d6af68f6a5d421812e6fa8db4d5fd5ccf1896e87ae9

See more details on using hashes here.

File details

Details for the file pyavroc-0.6.1-py2.6-linux-x86_64.egg.

File metadata

File hashes

Hashes for pyavroc-0.6.1-py2.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 89d7cda5c0f67606b232c7f17e1ddbfcdbd006877647ecf12ddfb6ab9d968803
MD5 dd470b3c978b74fb2555fcf1728e433e
BLAKE2b-256 4784d434d4cb6955973e0bfdb9e5a58627b371ad1be2e6419290666ab0414aaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page