avroc
avroc is a Python just-in-time compiler for reading and writing Avro data.
It aims to be:
- Completely correct to the Avro specification.
- Very, very fast when compiled. Our goal is to be the fastest library available in Python for dealing with Avro.
- Ergonomic and simple to use, with a small API that's clear.
Installation
Install with pip:
pip install avroc
Basic usage
import avroc
# Make up a schema
schema = {
"type": "record",
"name": "Weather",
"fields": [
{"name": "temperature", "type": "double"},
{"name": "wind_speed", "type": "double"},
{"name": "location", "type": "string"},
]
}
# Make up some records
records = [
{"temperature": 71.2, "wind_speed": 0.5, "location": "San Diego"},
{"temperature": 8.2, "wind_speed": 13.4, "location": "North Pole"},
{"temperature": -66.0, "wind_speed": 14.4, "location": "Mars"},
]
# Write records to a file
with open("data.avro, "wb") as f:
avroc.write_file(f, schema, records)
# Read records from a file
with open("data.avro", "rb") as f:
for msg in avroc.read_file(f):
print(f'The temperature in {msg["location"]} is {msg["temperature"]}')
# Encode a single record as raw bytes
encoder = avroc.compile_encoder(schema)
raw_bytes = encoder(records[0])
# Decode a raw bytes as a single record
decoder = avroc.compile_decoder(schema)
rec = decoder(io.BytesIO(raw_bytes))
For a lot more detail, see the documentation: avroc.readthedocs.io
Metadata
Release files for avroc 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| avroc-0.3.1.tar.gz | 30.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| avroc-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.0 kB
Release files / avroc-0.3.1.tar.gz
| Download URL | avroc-0.3.1.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe90bb2ad877573b47da56b54850ebd7253c39e1ce13cd2b36392c1bd9fcda83
|
|
BLAKE2b-256 checksum How to use checksums |
d9fd1699b453b0e748f718c1796190ecd85f22522a134a21c18a494ecf686f19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10
|
Release files / avroc-0.3.1-py3-none-any.whl
| Download URL | avroc-0.3.1-py3-none-any.whl |
|---|---|
| Size | 38.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4300a760eb465610d1a818937fd2fa71fdd34cdd0979eb1cca036e52cd657757
|
|
BLAKE2b-256 checksum How to use checksums |
7c5642544d2f0a059bac46faa31ad026aa53dd526a179bc9c1e60f1add45ea6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10
|
Security for avroc 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.