Metadata-Version: 2.1
Name: protobuf2pydantic
Version: 2021.1.20
Summary: Generate a file which include pydantic models by protobuf.pb2 file
Home-page: https://github.com/Ed-XCF/protobuf2pydantic
Author: Ed__xu__Ed
Author-email: m.tofu@qq.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: grpcio (>=1.32.0)
Requires-Dist: grpcio-tools (>=1.32.0)
Requires-Dist: typer (>=0.3.2)
Requires-Dist: pydantic (>=1.7.3)

# protobuf2pydantic

![GitHub](https://img.shields.io/github/license/Ed-XCF/protobuf2pydantic)
[![Build Status](https://www.travis-ci.org/Ed-XCF/protobuf2pydantic.svg?branch=main)](https://www.travis-ci.org/Ed-XCF/protobuf2pydantic)
[![codecov](https://codecov.io/gh/Ed-XCF/protobuf2pydantic/branch/main/graph/badge.svg?token=4YYBSTLS5F)](https://codecov.io/gh/Ed-XCF/protobuf2pydantic)
![PyPI](https://img.shields.io/pypi/v/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";
### * No plan to support "oneof"


