Another MessagePack library
Project description
amsgpack - Python Message Pack module
C library for python 3.10+.
Why:
- I couldn't negotiate adding type hints to msgpack-python
- I couldn't negotiate adding Unpacker to ormsgpack
- There's no stream unpacking in msgspec
- I couldn't find another MessagePack library
msgpack-pythoninterfaces are messy and the library is a bit slow
Installation
pip install amsgpack
Examples
>>> from amsgpack import packb, unpackb
>>> packb({"compact": True, "schema": 0})
b'\x82\xa7compact\xc3\xa6schema\x00'
>>> unpackb(b'\x82\xa7compact\xc3\xa6schema\x00')
{'compact': True, 'schema': 0}
>>> from amsgpack import FileUnpacker
>>> from io import BytesIO
>>> for data in FileUnpacker(BytesIO(b'\x00\x01\x02')):
... print(data)
...
0
1
2
>>> from amsgpack import Unpacker
>>> unpacker = Unpacker()
>>> unpacker.feed(b'\x82\xa7compact\xc3\xa6schema\x00')
>>> next(unpacker)
{'compact': True, 'schema': 0}
Benchmark
Run
amsgpack_benchmark.py and then chart.py to get your values
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
amsgpack-0.1.1.tar.gz
(53.5 kB
view details)
File details
Details for the file amsgpack-0.1.1.tar.gz.
File metadata
- Download URL: amsgpack-0.1.1.tar.gz
- Upload date:
- Size: 53.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aabd7b3d42619d00a3ef3d9c36b0bd27af83df24c153eacdb8d275e458459cc0
|
|
| MD5 |
3cdc40c0a723c106be4198b7e4110403
|
|
| BLAKE2b-256 |
e2b9b2f3dfed4acd675763bbdde98a20476a2932cc0d212a869f252eaf5f7294
|