Skip to main content

protobuf2arr-tools

Utility functions and generators for working with the Google protobuf array format.

Proto model generator

Generate a protobuf model from an unknown format protobuf array object. Often times we get protobuf array messages from Google internal services and need to build proto models to interact with them. This tool generates a template for that protobuf array by trying to guess the data type of each index.

CLI Usage

usage: proto_builder.py [-h] [--package PACKAGE] arr_json output_proto

Build a .proto model for an protobuf array.

positional arguments:
  arr_json           File containing the arr protobuf object.
  output_proto       File name to save the output .proto model.

options:
  -h, --help         show this help message and exit
  --package PACKAGE  .proto model package name.

Example

>>> head data.json
[[null, [[1650289911312855, 44780456, 1997349351], null, 2], 0, "92xdYpeME6iXrcUP58O0uAc"], [[[[["YSF", 0], "Hello World", ... 

>>> proto_builder.py data.json message.proto
Generated protobuf model: message.proto

>>> head message.proto
syntax = "proto3";

package generated;

message EntryPoint {
	Msg2 msg1 = 1;
	Msg11 msg2 = 2;
	string none3 = 3 [(nullable) = ''];
	Msg29 msg4 = 4;
	string none5 = 5 [(nullable) = ''];
	string none6 = 6 [(nullable) = ''];
	Msg31Container msg7 = 7;
	Msg41 msg8 = 8;
	string none9 = 9 [(nullable) = ''];
	string none10 = 10 [(nullable) = ''];
	string none11 = 11 [(nullable) = ''];
	Msg42Container msg12 = 12;
	Msg3 msg13 = 13;
	string none14 = 14 [(nullable) = ''];
	Msg1 msg15 = 15;
	string none16 = 16 [(nullable) = ''];
	string none17 = 17 [(nullable) = ''];
	Msg47 msg18 = 18;
	Msg3 msg19 = 19;
	string none20 = 20 [(nullable) = ''];
	bool field21 = 21;
}

...

Metadata

Release files for protobuf2arr-tools 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for protobuf2arr-tools 0.1.1
File Size Uploaded Provenance Actions
protobuf2arr-tools-0.1.1.tar.gz 5.0 kB Without provenance Details for protobuf2arr-tools-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for protobuf2arr-tools 0.1.1
File Interpreter ABI Platform Actions
protobuf2arr_tools-0.1.1-py3-none-any.whl Python 3 none any Details for protobuf2arr_tools-0.1.1-py3-none-any.whl

Total release size: 10.3 kB

Release files / protobuf2arr-tools-0.1.1.tar.gz

Download URL protobuf2arr-tools-0.1.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6efd8d0cef3fd767b92765037391095876ec989ec591b9781e69fffacc8e5e21
BLAKE2b-256 checksum
How to use checksums
11138438d81b13879fe6de823dac14cc38e53ab578ab622cbc2bd009c19608f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / protobuf2arr_tools-0.1.1-py3-none-any.whl

Download URL protobuf2arr_tools-0.1.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f27a19d843e32c303557a3f51eec1af2bd7b07a6d08182d4ae3dd9b2ee2fc4c
BLAKE2b-256 checksum
How to use checksums
70e028c71e0654333d27f475f60ab602b8b261a9a98f97302fe39fcbcbc463aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Security for protobuf2arr-tools 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page