python-msgpack
Port variant py38
Summary MessagePack (de)serializer (PY38)
Package version 1.0.2
Homepage https://msgpack.org/
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py39
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 27 DEC 2020, 06:48:23 UTC
Port created 09 JAN 2018, 17:05:01 UTC
Subpackage Descriptions
single # MessagePack for Python [Build Status] [Documentation Status] ## What's this [MessagePack] is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. This package provides CPython bindings for reading and writing MessagePack data. ## Very important notes for existing users ### PyPI package name Package name on PyPI was changed from `msgpack-python` to `msgpack` from 0.5. When upgrading from msgpack-0.4 or earlier, do `pip uninstall msgpack-python` before `pip install -U msgpack`. ### Compatibility with the old format You can use `use_bin_type=False` option to pack `bytes` object into raw type in the old msgpack spec, instead of bin type in new msgpack spec. You can unpack old msgpack format using `raw=True` option. It unpacks str (raw) type in msgpack into Python bytes. See note below for detail. ### Major breaking changes in msgpack 1.0 * Python 2 * The extension module does not support Python 2 anymore. The pure Python implementation (`msgpack.fallback`) is used for Python 2. * Packer * `use_bin_type=True` by default. bytes are encoded in bin type in msgpack. **If you are still using Python 2, you must use unicode for all string types.** You can use `use_bin_type=False` to encode into old msgpack format. * `encoding` option is removed. UTF-8 is used always. * Unpacker * `raw=False` by default. It assumes str types are valid UTF-8 string and decode them to Python str (unicode) object. * `encoding` option is removed. You can use `raw=True` to support old format. * Default value of `max_buffer_size` is changed from 0 to 100 MiB. * Default value of `strict_map_key` is changed to True to avoid hashdos. You need to pass `strict_map_key=False` if you have data which contain map keys which type is not bytes or str. ## Install ``` $ pip install msgpack ``` ### Pure Python implementation The extension module in msgpack (`msgpack._cmsgpack`) does not support Python 2 and PyPy. But msgpack provides a pure Python implementation (`msgpack.fallback`) for PyPy and Python 2. Since the [pip] uses the pure Python implementation, Python 2 support will not be dropped in the foreseeable future. ### Windows When you can't use a binary distribution, you need to install Visual Studio or Windows SDK on Windows. Without extension, using pure Python implementation on CPython runs slowly. ## How to use NOTE: In examples below, I use `raw=False` and `use_bin_type=True` for users using msgpack < 1.0. These options are default from msgpack 1.0 so you can omit them. ### One-shot pack & unpack Use `packb` for packing and `unpackb` for unpacking. msgpack provides `dumps` and `loads` as an alias for compatibility with `json` and `pickle`.
Configuration Switches (platform-specific settings discarded)
PY38 ON Build using Python 3.8 PY39 OFF Build using Python 3.9
Package Dependencies by Type
Build (only) python-setuptools:single:py38
autoselect-python:single:standard
Build and Runtime python38:single:standard
Download groups
main mirror://PYPI/m/msgpack
Distribution File Information
fae04496f5bc150eefad4e9571d1a76c55d021325dcd484ce45065ebbdd00984 123033 msgpack-1.0.2.tar.gz
Ports that require python-msgpack:py38
python-salt:py38 Remote execution and config mgmt system (PY 38)