aliyun-log-fastpb
Fast protobuf serialization for Aliyun Log using PyO3 and quick-protobuf
What it is and what it does
Aliyun-log-fastpb is a Rust-based protobuf serializer for Aliyun Log (SLS) data structures, designed to accelerate the conversion of log dictionaries into binary protobuf format. It wraps quick-protobuf and PyO3 to provide native-speed serialization without the overhead of pure-Python implementations. The package accepts log data as Python dictionaries containing LogItems (with timestamps and key-value content pairs), LogTags, topic, and source fields, then converts them directly to protobuf bytes suitable for transmission to Aliyun Log Service.
The package supports three serialization modes: standard text-based content, binary data (for non-UTF-8 payloads), and nanosecond-precision timestamps via an optional TimeNs field. It targets Python 3.7 through 3.12 on CPython and PyPy, with precompiled wheels for x86_64, ARM, PowerPC, s390x, and i686 architectures across Linux, macOS, and Windows, plus musl-based systems. No runtime dependencies are required beyond Python itself.
Use it for:
- Batch-serialize application logs to protobuf for high-throughput ingestion into Aliyun Log Service.
- Convert structured log events (with timestamps and key-value pairs) to binary format for network transmission.
- Handle binary log payloads (e.g., encoded traces, metrics) that cannot be represented as UTF-8 strings.
- Achieve nanosecond-precision event timing in log records for microsecond-scale event correlation.
- Integrate log serialization into performance-critical paths where Python overhead is unacceptable.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Serializes Aliyun Log data structures to protobuf bytes using Rust-backed performance optimization, supporting standard text, binary, and nanosecond-precision timestamp fields.
Yes, if you are sending logs to Aliyun Log Service and need faster protobuf serialization than pure-Python libraries provide. The Rust implementation, zero runtime dependencies, and broad platform coverage make it a straightforward drop-in for Aliyun-specific logging pipelines. Install friction is moderate due to compiled wheels, but prebuilt binaries cover most common environments. No known security issues and active maintenance status support adoption.
Install
aliyun-log-fastpb on PyPI
pip
pip install aliyun-log-fastpbuv
uv add aliyun-log-fastpbpoetry
poetry add aliyun-log-fastpbInstalling aliyun-log-fastpb
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for common platforms (x86_64, ARM, PowerPC, s390x on Linux/macOS/Windows, plus musl variants), but requires Python 3.7+ and may need fallback compilation on uncommon architectures.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects.
Quickstart
pip install aliyun-log-fastpb
import aliyun_log_fastpb
log_group = {
"LogItems": [{"Time": 1234567890, "Contents": [{"Key": "level", "Value": "INFO"}]}],
"Topic": "app-logs",
"Source": "192.168.1.100"
}
pb_bytes = aliyun_log_fastpb.serialize_log_group(log_group)
Requires Python 3.7 or later; binary wheels cover common platforms but uncommon architectures may require a Rust toolchain to compile.
Verify before relying
- Whether the package is actively maintained beyond the 108 days since latest release (repo metadata unavailable).
- Performance benchmarks comparing this implementation to pure-Python protobuf alternatives.
- Compatibility with Aliyun Log Service API versions and any breaking changes in protobuf schema.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 108 days since the last release |
| First released | |
| Downloads | 119,144/month — #12,086 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aliyun_log_fastpb-0.3.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-musllinux_1_2_aarch64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-musllinux_1_2_armv7l.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-musllinux_1_2_i686.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-musllinux_1_2_x86_64.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-win32.whl; aliyun_log_fastpb-0.3.0-cp37-abi3-win_amd64.whl
Keywords: aliyun, protobuf, log, sls, performance
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
betterproto-rust-codecProvides fast Rust-based conversion between…
permissive · top 15,000 on PyPI
aliyun-log-python-sdkPython SDK for Alibaba Cloud Log Service that…
permissive · top 15,000 on PyPI
foxglove-schemas-protobufProvides precompiled Protobuf message classes…
permissive · top 15,000 on PyPI
aristaprotoGenerates Python gRPC stubs and message classes…
permissive · top 15,000 on PyPI
alibabacloud-gateway-sls-utilProvides utility functions for Alibaba Cloud…
permissive · top 15,000 on PyPI
opentelemetry-exporter-otlp-proto-commonProvides Protobuf encoding utilities for…
permissive · top 1,000 on PyPI
opentelemetry-protoProvides generated protobuf message classes for…
permissive · top 1,000 on PyPI
protobuf-py-extNative Rust-based encoder/decoder extension…
unclear · top 15,000 on PyPI
protobuf-pyGenerates well-typed, readable Python code from…
permissive · top 15,000 on PyPI
pure-protobufEncodes and decodes Protocol Buffer messages…
permissive · top 15,000 on PyPI