{"categories":[{"label":"Build Tools","url":"https://skillfed.io/packages/category/software-development-build-tools/2"}],"enrichment":{"capability":"Converts Protobuf message definitions into Pydantic models with validation, either as generated source code via a protoc plugin or as runtime-instantiated classes in Python.","skillfed_tags":["code-generation","protobuf","schema-validation"],"use_cases":["Generate type-safe Pydantic models from existing .proto schemas to avoid manual dataclass duplication and keep definitions synchronized.","Add Pydantic validation to Protobuf messages in gRPC services without rewriting message definitions.","Convert Protobuf validation rules into Pydantic field constraints during code generation.","Dynamically instantiate Pydantic models from Protobuf Message objects at runtime for serialization or API responses.","Maintain a single source of truth for message schemas across Protobuf and Python codebases with automatic synchronization."],"what_it_does":"protobuf_to_pydantic bridges Protobuf message definitions and Pydantic models, letting you generate validated Python dataclasses from .proto files. It works in two modes: as a protoc plugin that generates source code files (the recommended approach), or at runtime by parsing Protobuf Message objects directly into Pydantic classes. The generated models inherit Pydantic's validation rules and are compatible with both Pydantic V1 and V2.\n\nThe package supports multiple validation rule sets including proto-gen-validate, and allows customization through template configuration. It depends on pydantic and protobuf at runtime, making integration straightforward for projects already using either library. The plugin mode generates files with a _p2p.py suffix, keeping generated code separate from hand-written code.","worth_installing":"Yes. The package solves a real friction point\u2014keeping Protobuf schemas and Pydantic models in sync\u2014with low install overhead, active maintenance, permissive licensing, and no known vulnerabilities. It supports Python 3.7 through 3.12 and integrates cleanly into existing protoc workflows. Install it if your project uses both protobuf and pydantic and you want to avoid hand-maintaining duplicate message definitions."},"id":"protobuf-to-pydantic","links":{"html":"https://skillfed.io/packages/protobuf-to-pydantic","md":"https://skillfed.io/packages/protobuf-to-pydantic.md","pypi":"https://pypi.org/project/protobuf-to-pydantic/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-06-07","license_spdx":null,"license_treatment":"permissive","name":"protobuf_to_pydantic","python_support":"supports_current","summary":"Generate the `pydantic.BaseModel` class (and the corresponding source code) with parameter verification function through the Protobuf file"},"popularity":{"monthly_downloads":520804,"position":6208,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.3.1"}
