aliyun-log-fastpb

raw JSON →
0.3.0 verified Fri May 01 auth: no python

Fast protobuf serialization for Aliyun Log Service using PyO3 and quick-protobuf. Version 0.3.0. Released occasionally.

pip install aliyun-log-fastpb
error ModuleNotFoundError: No module named 'aliyun_log_fastpb.fastpb'
cause Old import path used after library refactoring.
fix
Use 'from aliyun_log_fastpb import FastProtobuf'
error ImportError: cannot import name 'FastProtobuf' from 'aliyun_log_fastpb'
cause Library version mismatch: FastProtobuf class may be named differently in very old versions.
fix
Update library to >=0.3.0: pip install --upgrade aliyun-log-fastpb
deprecated The old import path 'aliyun_log_fastpb.fastpb' is deprecated. Use 'aliyun_log_fastpb' directly.
fix Change import to 'from aliyun_log_fastpb import FastProtobuf'
gotcha Only supports Python 3.7+ due to PyO3 and binary wheels. On older Python versions, installation will fail.
fix Upgrade Python to 3.7 or later.
gotcha The serialization expects a dict with specific field types. Passing incorrect types may cause runtime errors without clear messages.
fix Ensure all values in the dict are of the expected protobuf types (e.g., strings, ints, floats).

Create a FastProtobuf instance and serialize a dict.

from aliyun_log_fastpb import FastProtobuf
pb = FastProtobuf()
data = pb.serialize({'key': 'value'})
print(data)