--- id: msgpack-numpy version: "0.4.8" license: BSD license_treatment: permissive maintenance: dormant --- # msgpack-numpy — Numpy data serialization using msgpack License: permissive · Maintenance: dormant · Downloads: 1.1M/mo ## What it is and what it does msgpack-numpy bridges NumPy and msgpack by adding custom encoders and decoders that let you serialize NumPy arrays and Python complex numbers into msgpack's compact binary format while preserving their data types. It works in two modes: monkey-patching msgpack globally to make all serialization NumPy-aware, or passing its encoder and decoder functions manually to msgpack routines. The package trades some storage overhead for type fidelity—serialized data includes type information so deserialized arrays come back as the correct dtype. For object-dtype arrays, it falls back to pickle, which adds overhead and negates some of msgpack's efficiency gains. Deserialized arrays are read-only and must be copied if you need to modify them. Use it for: - Serialize NumPy arrays for storage or network transmission while preserving dtype information across systems. - Exchange numerical data between Python processes or services using msgpack's efficient binary protocol. - Monkey-patch msgpack in a library or application to make all downstream serialization NumPy-aware without code changes. - Manually encode/decode specific NumPy arrays in a custom serialization pipeline where msgpack is already in use. - Handle Python complex numbers in msgpack serialization when NumPy arrays are not the primary payload. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Serializes and deserializes NumPy arrays and Python complex types using the msgpack binary format, preserving numerical data types during encoding and decoding. Yes, if you need to serialize NumPy arrays with msgpack and your project tolerates dormant maintenance. The package is stable, has no known vulnerabilities, and low install friction. However, verify compatibility with your Python version (last release was 2022-06-09) and confirm that read-only deserialized arrays and the object-dtype pickle fallback fit your workflow. ## Install pip install msgpack-numpy uv add msgpack-numpy poetry add msgpack-numpy ## Installing msgpack-numpy Before you install: Low install friction with a pure-Python wheel distribution. Maintenance is dormant—last release was 2022-06-09 with no commits since 2024-07-19—so expect no active bug fixes or feature updates. License in practice: BSD license is permissive, allowing commercial and private use with minimal restrictions. Quickstart: import msgpack import msgpack_numpy as m m.patch() # Now all msgpack calls handle numpy arrays x_enc = msgpack.packb(x) x_rec = msgpack.unpackb(x_enc) Requires numpy and msgpack as runtime dependencies; deserialized arrays are read-only and must be copied if modification is needed. Verify before relying: - Whether deserialized arrays' read-only constraint materially affects performance in typical workflows. - Current compatibility with Python versions beyond 3.8, given the last release predates recent Python versions. - Whether pickle fallback for object-dtype arrays introduces security concerns in untrusted data scenarios. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags numpy array serialization msgpack, msgpack numpy encoding, serialize numpy arrays binary, msgpack numpy decoder, numpy dtype preservation serialization, efficient numpy data format, msgpack complex number support, serialization, numpy-integration [View on SkillFed](https://skillfed.io/packages/msgpack-numpy) · [View on PyPI](https://pypi.org/project/msgpack-numpy/)