{"id":13737544,"url":"https://github.com/Ed-XCF/protobuf2pydantic","last_synced_at":"2025-05-08T14:32:07.981Z","repository":{"id":47794233,"uuid":"326435470","full_name":"Ed-XCF/protobuf2pydantic","owner":"Ed-XCF","description":"generate pydantic model by protobuf.pb2 file","archived":false,"fork":false,"pushed_at":"2024-04-18T06:29:21.000Z","size":46,"stargazers_count":60,"open_issues_count":3,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-03T11:19:37.946Z","etag":null,"topics":["grpc-python","pydantic"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ed-XCF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-03T15:14:22.000Z","updated_at":"2024-08-17T14:02:59.000Z","dependencies_parsed_at":"2024-01-12T04:56:43.132Z","dependency_job_id":"a9692b5e-effc-4ba5-921c-436294b064cf","html_url":"https://github.com/Ed-XCF/protobuf2pydantic","commit_stats":{"total_commits":33,"total_committers":6,"mean_commits":5.5,"dds":0.1515151515151515,"last_synced_commit":"d184c118eac463af22bc762519edf5086cb654ac"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-XCF%2Fprotobuf2pydantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-XCF%2Fprotobuf2pydantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-XCF%2Fprotobuf2pydantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ed-XCF%2Fprotobuf2pydantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ed-XCF","download_url":"https://codeload.github.com/Ed-XCF/protobuf2pydantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224127200,"owners_count":17260180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc-python","pydantic"],"created_at":"2024-08-03T03:01:52.768Z","updated_at":"2025-05-08T14:32:07.974Z","avatar_url":"https://github.com/Ed-XCF.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# protobuf2pydantic\n\n![GitHub](https://img.shields.io/github/license/Ed-XCF/protobuf2pydantic)\n[![Build Status](https://www.travis-ci.org/Ed-XCF/protobuf2pydantic.svg?branch=main)](https://www.travis-ci.org/Ed-XCF/protobuf2pydantic)\n[![codecov](https://codecov.io/gh/Ed-XCF/protobuf2pydantic/branch/main/graph/badge.svg?token=4YYBSTLS5F)](https://codecov.io/gh/Ed-XCF/protobuf2pydantic)\n![PyPI](https://img.shields.io/pypi/v/protobuf2pydantic)\n[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Ed-XCF/protobuf2pydantic.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/Ed-XCF/protobuf2pydantic/context:python)\n\n### Generate a file which include pydantic models by using protobuf.pb2 file\n## Installation\n```shell\npip3 install protobuf2pydantic\n```\n\n## Getting Started\n### in CLI\n```shell\npb2py ../test_pb2.py \u003e wow.py\n```\n\n### in Python\n```python\nfrom protobuf2pydantic import msg2py\nfrom pydantic import validator\n\nimport transaction_pb2\n\n\nclass AmountResponse(msg2py(transaction_pb2.AmountResponse)):\n    @validator(\"amount\")\n    def non_negative(cls, v):\n        assert v \u003e= 0\n        return v\n```\n\n### * Required proto file syntax = \"proto3\";\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEd-XCF%2Fprotobuf2pydantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEd-XCF%2Fprotobuf2pydantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEd-XCF%2Fprotobuf2pydantic/lists"}