skillfed

protobuf3-to-dict

Ben Hodgson: A teeny Python library for creating Python dicts from protocol buffers and the reverse. Useful as an intermediate step before serialisation (e.g. to JSON). Kapor: upgrade it to PB3 and PY3, rename it to protobuf3-to-dict

protobuf3-to-dict v0.1.5 8.0M downloads/30d#1,670 on PyPI74
Permissive license Public Domain Abandoned released

What it is and what it does

protobuf3-to-dict bridges protocol buffers and Python dictionaries, converting protobuf Message objects to dicts suitable for JSON serialization and back. It handles type conversions automatically—bytes become base64 strings, datetime objects map to Google's Timestamp type, and enums can be rendered as integers or string labels. The library also supports field validation using custom protobuf options to enforce required fields in Protobuf 3, where all fields are technically optional.

The package is a fork aimed at Protobuf 3 and Python 3 compatibility, though it has not been actively maintained since 2017. It carries no runtime dependencies and works as a thin conversion layer between serialization formats.

Use it for:

  • Convert protobuf messages to JSON by first materializing them as dicts for JSON serialization
  • Validate incoming dictionary data against protobuf message schemas before converting to protobuf objects
  • Inspect and manipulate protobuf message fields and options programmatically without hand-coding schema reflection
  • Round-trip protobuf messages through dict representation for testing or intermediate processing

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts protocol buffer messages to Python dictionaries and back, with built-in support for datetime conversion and field validation.

No. The package is abandoned (last commit 2022-05-31) and requires non-standard git-based installation. High install friction combined with stale maintenance makes this a poor choice for new projects.

Install

protobuf3-to-dict on PyPI

pip

pip install protobuf3-to-dict

uv

uv add protobuf3-to-dict

poetry

poetry add protobuf3-to-dict

Installing protobuf3-to-dict

Before you install

High install friction: requires git-based installation from a fork rather than PyPI. Maintenance is abandoned—last commit was 2022-05-31, over three years ago. No active development or support.

License in practice

Public Domain license means no restrictions on use, modification, or distribution. You may use this freely in any context, commercial or otherwise, with no attribution requirement.

Quickstart

from protobuf3_to_dict import protobuf_to_dict, dict_to_protobuf
my_message_dict = protobuf_to_dict(my_message)
msg = dict_to_protobuf(MyMessage, values=my_message_dict)

Requires git-based installation; expects a google.protobuf.message.Message subclass as input.

Verify before relying

  • Compatibility with current protobuf library versions (last release 2017-02-23)
  • Whether the fork referenced in the description is actively maintained or also abandoned
  • Python 3 support level beyond the listed 3.5 classifier
  • Whether native protobuf JSON support in Protobuf 3.0.0+ makes this package obsolete

Package facts

License Public Domain (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,459 days since the last release
Last repo commit
First released
Downloads 8,034,136/month — #1,670 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: protobuf3-to-dict-0.1.5.tar.gz

Keywords: protobuf, json, dict

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: Public DomainOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Topic :: Software Development :: Libraries :: Python Modules

Tags

protobuf to dict conversionprotocol buffer serializationprotobuf json intermediateconvert protobuf messageprotobuf dict mapping
protobuf-serializationabandoned-maintenance

More Python Modules packages