msgpack-numpy-opentensor
Numpy data serialization using msgpack
What it is and what it does
msgpack-numpy bridges NumPy and msgpack by adding type-aware serialization for NumPy arrays and Python complex numbers. It works by providing custom encoder and decoder functions that preserve dtype information during msgpack serialization, or by monkey-patching msgpack globally so all serialization calls become NumPy-aware automatically.
The package is designed for scenarios where you need efficient, compact binary serialization of numerical data while preserving type information across serialization boundaries. It trades some storage overhead (for type metadata) against the convenience of not having to manually reconstruct dtypes after deserialization. The main constraint is that deserialized arrays are read-only, and arrays with object dtype ('O') fall back to pickle, which defeats much of msgpack's efficiency advantage.
Use it for:
- Serialize NumPy arrays to disk or network in a compact binary format while preserving dtype information.
- Make msgpack-based RPC or message-passing systems NumPy-aware without modifying existing msgpack call sites.
- Exchange numerical data between Python processes or services using msgpack as the transport layer.
- Store machine learning model weights or intermediate tensors in a format more efficient than JSON or pickle.
- Integrate NumPy serialization into existing msgpack-based data pipelines without rewriting encoder/decoder logic.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Serializes and deserializes NumPy arrays and Python complex types using msgpack's efficient binary format, with optional monkey-patching to make msgpack globally NumPy-aware.
Yes, if you already use msgpack and need NumPy array serialization with type preservation. No, if you are starting a new project—the dormant maintenance (last release 2023-10-02, no recent commits) and low GitHub stars (2) suggest limited community support and risk of compatibility drift with future NumPy or msgpack releases. Consider pickle or Protocol Buffers for new work unless msgpack integration is a hard requirement.
Install
msgpack-numpy-opentensor on PyPI
pip
pip install msgpack-numpy-opentensoruv
uv add msgpack-numpy-opentensorpoetry
poetry add msgpack-numpy-opentensorInstalling msgpack-numpy-opentensor
Before you install
Low friction: pure wheel distribution with only two runtime dependencies (numpy and msgpack). Maintenance is dormant—last release was 2023-10-02 and no commits since then—so expect no active bug fixes or updates.
License in practice
BSD permissive license allows use in most commercial and open-source projects without significant restrictions.
Quickstart
import msgpack
import msgpack_numpy as m
import numpy as np
m.patch() # Make all msgpack calls NumPy-aware
x = np.random.rand(5)
x_enc = msgpack.packb(x)
x_rec = msgpack.unpackb(x_enc)
Deserialized NumPy arrays are read-only; copy them before modification. Arrays with dtype 'O' fall back to pickle, negating msgpack efficiency gains.
Verify before relying
- Whether the package works reliably with modern NumPy and msgpack versions beyond what classifiers claim.
- Performance characteristics compared to alternatives like pickle or Protocol Buffers for typical workloads.
- Whether the dormant maintenance status poses compatibility risks with future Python releases.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, msgpack |
| Maintenance | dormant — 1,047 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 215,354/month — #9,402 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: msgpack_numpy_opentensor-0.5.0-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
msgpack-numpySerializes and deserializes NumPy arrays and…
permissive · top 5,000 on PyPI
msgpackmsgpack serializes and deserializes Python…
permissive · top 1,000 on PyPI
u-msgpack-pythonu-msgpack-python serializes and deserializes…
permissive · top 5,000 on PyPI
msgpack-pythonMessagePack serialization and deserialization…
permissive · top 5,000 on PyPI
json-numpyProvides lossless JSON encoding and decoding…
permissive · top 15,000 on PyPI
ormsgpackormsgpack is a fast MessagePack serialization…
permissive · top 1,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
py-ubjsonEncodes and decodes data in Universal Binary…
permissive · top 5,000 on PyPI
jsonpicklejsonpickle converts complex Python objects to…
permissive · top 5,000 on PyPI
srslysrsly provides a unified API for serializing…
permissive · top 1,000 on PyPI