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
- I couldn't find another msgpack 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})
bytearray(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}
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.0.4.tar.gz
(17.7 kB
view details)
File details
Details for the file amsgpack-0.0.4.tar.gz.
File metadata
- Download URL: amsgpack-0.0.4.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e5ef3dfffe78fa9d8a834f0f216008487f307e5fdabbee34a7bddf4ed91794f
|
|
| MD5 |
0eeaee81147411f712a26344bc520843
|
|
| BLAKE2b-256 |
628c5aab85dd7cb1c50332c23737c667b92c338271f7fe8d7f633574612daf5c
|