msgpack
MessagePack serializer
Decision gist · record as of 2026-08-14
Yes. msgpack is production-stable (Development Status 5), actively maintained, widely used (top 1000 PyPI by downloads), has no known vulnerabilities, and provides a genuine performance and size advantage over JSON for many use cases. Install friction is moderate but manageable via prebuilt wheels. Suitable for any project needing efficient binary serialization.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- C extension requires Visual Studio or Windows SDK on Windows if building from source; pure Python fallback is available but slower on CPython.
- Medium install friction due to compiled C extension bindings, though prebuilt wheels cover common platforms (CPython 3.10–3.11, Linux/macOS/Windows).
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
last release 2026-06-18 (57 days) · last repo commit 2026-08-12 · 2,100 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 286,646,957 downloads/mo, #143 on PyPI
Alternatives
Verify before relying
import msgpack
# One-shot pack and unpack
packed = msgpack.packb([1, 2, 3])
unpacked = msgpack.unpackb(packed)
print(unpacked) # [1, 2, 3]
# Streaming unpacking
unpacker = msgpack.Unpacker()
unpacker.feed(msgpack.packb(42))
for obj in unpacker:
print(obj)- Whether the C extension provides a measurable performance advantage for typical workloads compared to the pure Python fallback
- Compatibility guarantees or known issues with specific PyPy versions
What it is and what it does
msgpack is a Python binding for the MessagePack binary serialization format—a compact, language-agnostic alternative to JSON that trades human readability for speed and size. It provides both one-shot functions (packb/unpackb, dumps/loads) and streaming unpacking via the Unpacker class, along with hooks for serializing custom types like datetime objects or array.array instances using default and ext_hook callbacks.
The package ships with a fast C extension (msgpack._cmsgpack) for CPython and falls back to a pure Python implementation for PyPy. It includes security features like max_buffer_size (default 100 MiB) to prevent DoS attacks and strict_map_key validation. The API defaults to UTF-8 string handling and binary type distinction, with options to support older MessagePack specs.
Use it for
- Serialize structured data for efficient network transmission or storage when JSON overhead is unacceptable
- Implement streaming message processing pipelines using Unpacker to handle multiple objects from a single stream
- Exchange data between Python and other languages (Go, Rust, JavaScript, etc.) that support MessagePack
- Pack custom Python types like datetime or numpy arrays using default/ext_hook for domain-specific protocols
- Build cache backends or inter-process communication where compact binary format reduces memory and I/O cost
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
msgpack is production-stable (Development Status 5), actively maintained, widely used (top 1000 PyPI by downloads), has no known vulnerabilities, and provides a genuine performance and size advantage over JSON for many use cases. Install friction is moderate but manageable via prebuilt wheels. Suitable for any project needing efficient binary serialization.
Install
msgpack on PyPI
Before you install
Medium install friction due to compiled C extension bindings, though prebuilt wheels cover common platforms (CPython 3.10–3.11, Linux/macOS/Windows). Pure Python fallback available for PyPy. Last release 57 days ago; repository active with 2100 stars.
Requires Python 3.10 or later. C extension requires Visual Studio or Windows SDK on Windows if building from source; pure Python fallback is available but slower on CPython.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
import msgpack
# One-shot pack and unpack
packed = msgpack.packb([1, 2, 3])
unpacked = msgpack.unpackb(packed)
print(unpacked) # [1, 2, 3]
# Streaming unpacking
unpacker = msgpack.Unpacker()
unpacker.feed(msgpack.packb(42))
for obj in unpacker:
print(obj)
Verify before relying
- Whether the C extension provides a measurable performance advantage for typical workloads compared to the pure Python fallback
- Compatibility guarantees or known issues with specific PyPy versions
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 57 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 286,646,957 / month, #143 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: File Formats |
Evidence: msgpack-1.2.1-cp310-cp310-macosx_10_9_x86_64.whl; msgpack-1.2.1-cp310-cp310-macosx_11_0_arm64.whl; msgpack-1.2.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; msgpack-1.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; msgpack-1.2.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; msgpack-1.2.1-cp310-cp310-musllinux_1_2_aarch64.whl; msgpack-1.2.1-cp310-cp310-musllinux_1_2_riscv64.whl; msgpack-1.2.1-cp310-cp310-musllinux_1_2_x86_64.whl; msgpack-1.2.1-cp310-cp310-win32.whl; msgpack-1.2.1-cp310-cp310-win_amd64.whl; msgpack-1.2.1-cp311-cp311-macosx_10_9_x86_64.whl; msgpack-1.2.1-cp311-cp311-macosx_11_0_arm64.whl; msgpack-1.2.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; msgpack-1.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; msgpack-1.2.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; msgpack-1.2.1-cp311-cp311-musllinux_1_2_aarch64.whl; msgpack-1.2.1-cp311-cp311-musllinux_1_2_riscv64.whl; msgpack-1.2.1-cp311-cp311-musllinux_1_2_x86_64.whl; msgpack-1.2.1-cp311-cp311-win32.whl; msgpack-1.2.1-cp311-cp311-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “streaming message unpacking”
- msgpackmsgpack serializes and deserializes Python objects to and from…
- plum-pyTransforms byte sequences into Python objects and back using…
- slackblocksBuilds Slack Block Kit messages programmatically in Python with type…
Give your agent the search over MCP, or paste the wish link into any chat.
More File Formats packages
pyelftools parses and analyzes ELF binary files and DWARF debugging information in pure Python, with no external dependencies.
Install it if you need to read or analyze ELF binaries or debug information from Python.
Parses Outlook MSG files to extract email messages, attachments, and message properties like sent date and sender information.
StringZilla provides SIMD and SWAR-accelerated string operations including substring search, hashing, edit distances, sorting, and segmentation for Python, with no runtime dependencies.
Install only if your Python version is 3.10 or later.
borb reads, writes, and manipulates PDF files using a pure Python implementation with a JSON-like document model, supporting content creation, metadata management, and page layout.
Generates well-typed, readable Python code from Protocol Buffer definitions and provides high-performance serialization/deserialization with a modern, ergonomic API.
However, it is still in Alpha status with a first release only months old; production use should weigh stability risk against the benefits of better developer…
Loads, parses, and manipulates Common Workflow Language (CWL) documents across versions 1.0, 1.1, and 1.2, providing autogenerated typed classes and CLI utilities for workflow introspection and transformation.
See also ormsgpack · u-msgpack-python · plum-py · msgpack-numpy · msgpack-numpy-opentensor · msgpack-python · bitstruct · msgspec · srsly · kaitaistruct