protobuf2pydantic
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd16489b12deaec45f21be7c0bfa17d0a413a9995402f2fcaf0ed23199f9e1b
|
|
| MD5 |
a16412f4abffebcd290de359483378cd
|
|
| BLAKE2b-256 |
4ff799b0f427f307ea8c63c0bb8bfc87ac5259e60e0e4f0e561a9d7974232cf8
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
868d4e2c9f61606e454cbc898037e7c43b60a29c97617dcc9bb03035c9114f73
|
|
| MD5 |
e7fd794bd467df9a75918ccf17517264
|
|
| BLAKE2b-256 |
3769d3c13395a39ffe5d0199d223b484ac40663e89e16ec931e6c22ff87e0fbc
|