Skip to main content

protobuf2pydantic

GitHub Build Status codecov PyPI

Generate a file which include pydantic models by using protobuf.pb2 file

Installation

$ pip install protobuf2pydantic

Getting Started

in CLI

>>> pb2py ../test_pb2.py > wow.py

in Python

>>> from protobuf2pydantic import message2pydantic
>>> from tests.test_pb2 import TestMessage
>>>
>>> klass = message2pydantic(TestMessage)
>>> print(klass)
<class 'TestMessage'>
>>> print(type(klass))
<class 'pydantic.main.ModelMetaclass'>

* Required proto file syntax = "proto3";

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protobuf2pydantic-2021.5.31.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protobuf2pydantic-2021.5.31-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file protobuf2pydantic-2021.5.31.tar.gz.

File metadata

  • Download URL: protobuf2pydantic-2021.5.31.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.13

File hashes

Hashes for protobuf2pydantic-2021.5.31.tar.gz
Algorithm Hash digest
SHA256 2cd16489b12deaec45f21be7c0bfa17d0a413a9995402f2fcaf0ed23199f9e1b
MD5 a16412f4abffebcd290de359483378cd
BLAKE2b-256 4ff799b0f427f307ea8c63c0bb8bfc87ac5259e60e0e4f0e561a9d7974232cf8

See more details on using hashes here.

File details

Details for the file protobuf2pydantic-2021.5.31-py3-none-any.whl.

File metadata

  • Download URL: protobuf2pydantic-2021.5.31-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.13

File hashes

Hashes for protobuf2pydantic-2021.5.31-py3-none-any.whl
Algorithm Hash digest
SHA256 868d4e2c9f61606e454cbc898037e7c43b60a29c97617dcc9bb03035c9114f73
MD5 e7fd794bd467df9a75918ccf17517264
BLAKE2b-256 3769d3c13395a39ffe5d0199d223b484ac40663e89e16ec931e6c22ff87e0fbc

See more details on using hashes here.

Release history Release notifications | RSS feed

2023.12.21

2 files

2023.1.25

2 files

2021.11.25

2 files

This release

2021.5.31 This release

2 files

2021.1.20

2 files

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