qmetrics.net

MsgPack Python

Python bindings for MessagePack binary serialization

MsgPack Python screenshot

msgpack-python provides CPython bindings to pack and unpack MessagePack data. It offers one-shot and streaming APIs, optional pure-Python fallback, and security limits when decoding untrusted input.

Overview

MessagePack for Python lets applications serialize and deserialize data in the MessagePack binary format, similar in role to JSON but compact on the wire. The package centers on packb and unpackb, with dumps and loads aliases matching json and pickle naming.

You can stream multiple objects through an Unpacker that reads from bytes or file-like streams, pack to files with pack and dump, and register custom types via hooks or the ext type mechanism. Extended types and datetime handling follow documented packer options.

An accelerated C extension is the default on CPython; a pure Python implementation in msgpack.fallback supports PyPy when the extension is unavailable. On Windows, building the extension may require Visual Studio or the Windows SDK.

Unpacking from unreliable sources can use maxbuffersize and strictmapkey to cap buffers and restrict map key types against hash abuse. Performance notes in the documentation suggest tuning such as disabling GC or using tuples when unpacking large messages.

Key features

  • packb, unpackb, and streaming Unpacker
  • Custom types via object hooks and ext types
  • C extension with pure-Python fallback
  • File-like pack and load APIs
  • maxbuffersize and strictmapkey safety options
  • JSON-compatible dumps and loads aliases
  • Advanced unpack control methods
  • Legacy raw/binary compatibility flags

Use cases

  • Compact RPC or cache payloads versus JSON
  • Streaming many records from one byte stream
  • Cross-language data exchange using MessagePack
  • Decoding untrusted MessagePack with size limits

Tags

Similar software

MarkItDown

Python utility converting office and media files to Markdown

MarkItDown converts many file types into Markdown for LLM and text analysis pipelines. It aims to preserve headings, lists, tables, and links rather than perfect human layout.

★ 198.7k⟳ 21 days agoMIT

OpenBB

Open-source data integration platform for analysts, quants and AI agents

Open Data Platform (ODP) by OpenBB connects proprietary, licensed and public data sources once, then exposes them to Python, OpenBB Workspace, Excel, MCP servers for AI agents, and REST APIs.

★ 75.8k⟳ 9 days agoApache-2.0

Docling

Document parsing toolkit for generative AI pipelines

Docling ingests PDFs, office files, media, email, and many other formats into a unified document model. It targets downstream RAG and agent workflows with local execution options.

★ 71.1k⟳ yesterdayMIT

pandas

Python data structures for labeled analysis

pandas is a Python package for working with labeled, tabular, and time-series data. It provides Series and DataFrame objects with alignment, grouping, and rich import and export options.

★ 50.7k⟳ yesterdayBSD-3-Clause

RSSHub

Open RSS feed network with community-maintained routes

RSSHub aggregates content from many online sources into RSS feeds and is maintained as an open source project with a large network of deployed instances.

★ 47.4k⟳ yesterdayAGPL-3.0

jq

Portable command-line JSON processor

jq slices, filters, maps, and transforms JSON from the shell. It is a standalone C binary with no runtime dependencies, plus an online playground and optional Docker image.

★ 36.4k⟳ 26 days agoMIT · open core