# fastavro
[![Build Status](https://travis-ci.org/fastavro/fastavro.svg?branch=master)](https://travis-ci.org/fastavro/fastavro)
[![Documentation Status](https://readthedocs.org/projects/fastavro/badge/?version=latest)](http://fastavro.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/fastavro/fastavro/branch/master/graph/badge.svg)](https://codecov.io/gh/fastavro/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)
* Schema resolution
* Aliases
* Logical Types
## Missing Features
* Anything involving Avro's RPC features
* Parsing schemas into the canonical form
* Schema fingerprinting
[Cython]: http://cython.org/
# Documentation
Documentation is available at http://fastavro.readthedocs.io/en/latest/
# Installing
`fastavro` is available both on [PyPi](http://pypi.python.org/pypi)
pip install fastavro
and on [conda-forge](https://conda-forge.github.io) `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.
### Releasing
We release both to [pypi][pypi] and to [conda-forge][conda-forge].
We assume you have [twine][twine] installed and that you've created your own
fork of [fastavro-feedstock][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` and `sha256` variables at the top of the file
- Run `python recipe/test_recipe.py`
- Submit a [PR][pr]
[conda-forge]: https://conda-forge.org/
[feedstock]: https://github.com/conda-forge/fastavro-feedstock
[pr]: https://conda-forge.org/#update_recipe
[pypi]: https://pypi.python.org/pypi
[twine]: https://pypi.python.org/pypi/twine
# Changes
See the [ChangeLog]
[ChangeLog]: https://github.com/fastavro/fastavro/blob/master/ChangeLog
# Contact
[Project Home](https://github.com/fastavro/fastavro)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共135个文件
py:49个
avro:34个
rst:8个
资源分类:Python库 所属语言:Python 资源全名:fastavro-0.22.10.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
Python库 | fastavro-0.22.10.tar.gz (135个子文件)
test-snappy.avro 13KB
test-null.avro 13KB
test-deflate-0.avro 12KB
test-deflate-9.avro 12KB
test-deflate-1.avro 12KB
test-deflate-3-A.avro 12KB
test-deflate-1-A.avro 12KB
java-generated-uuid.avro 8KB
test-null-B.avro 6KB
test-deflate-6-B.avro 6KB
snappy.avro 3KB
deflate.avro 3KB
null.avro 3KB
a_triple_pair.avro 447B
m.avro 403B
weather.avro 358B
weather-sorted.avro 335B
weather-snappy.avro 330B
part-00000.avro 321B
lines.avro 299B
double_float.avro 276B
error-type.avro 234B
recursive.avro 218B
test.avro 182B
request.avro 162B
no-fields.avro 139B
class org.apache.avro.tool.TestDataFileTools.seperators.avro 106B
response.avro 89B
class org.apache.avro.tool.TestDataFileTools.testWrite.deflate.avro 89B
class org.apache.avro.tool.TestDataFileTools.testWrite.plain.avro 84B
bool.avro 79B
org.apache.avro.tool.TestDataFileTools.avro 68B
class org.apache.avro.tool.TestDataFileTools.zerojsonvalues.avro 56B
testDataFileMeta.avro 51B
Parent.avsc 179B
ParentMissingChild.avsc 130B
Child1.avsc 56B
Child.avsc 55B
_read.c 927KB
_write.c 897KB
_six.c 406KB
_logical_writers.c 390KB
_validation.c 377KB
_schema.c 341KB
setup.cfg 132B
ChangeLog 16KB
run-tests.cmd 480B
.flake8.cython 71B
Dockerfile 649B
MANIFEST.in 469B
tox.ini 256B
pytest.ini 31B
LICENSE 1KB
Makefile 5KB
Makefile 721B
README.md 4KB
not-zip-safe 1B
PKG-INFO 6KB
PKG-INFO 6KB
test_fastavro.py 53KB
_read_py.py 27KB
_write_py.py 19KB
test_logical_types.py 11KB
_validation_py.py 11KB
test_validation.py 9KB
conf.py 8KB
_schema_py.py 8KB
test_json.py 8KB
_logical_writers_py.py 6KB
test_schema.py 6KB
six.py 5KB
test_schema_evolution.py 5KB
json_encoder.py 5KB
json_decoder.py 5KB
test_timezone.py 5KB
test_compression.py 5KB
parser.py 4KB
binary_decoder.py 4KB
test_complex.py 4KB
test_schemaless.py 4KB
test_main_cli.py 4KB
setup.py 3KB
test_block_reader.py 3KB
test_aliases.py 3KB
__main__.py 3KB
test_six.py 2KB
test_promotion.py 2KB
symbols.py 2KB
test_write_block.py 2KB
__init__.py 2KB
binary_encoder.py 2KB
test_types.py 2KB
_validate_common.py 2KB
json_write.py 1KB
test_str_py3.py 1KB
conftest.py 1KB
json_read.py 905B
_read_common.py 879B
_schema_common.py 736B
_timezone.py 724B
共 135 条
- 1
- 2
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功