skillfed

protoc-gen-validate

PGV for python via just-in-time code generation

protoc-gen-validate v1.3.3 208.1K downloads/30d#9,535 on PyPI4,120
License unclear Abandoned released

What it is and what it does

Protoc-gen-validate is a Python implementation that enforces semantic validation rules on protocol buffer messages at runtime. While protobuf's type system guarantees structural correctness, it cannot enforce business logic constraints like value ranges, string patterns, or required relationships between fields. This package reads validation annotations embedded in your protobuf schema and applies runtime checks that raise ValidationFailed when a message violates those constraints.

The package depends on Jinja2, protobuf, and validate-email to generate and execute validators. It supports Python 3.10 through 3.13 and installs with low friction as a pure Python wheel. The repository is archived and abandoned, meaning no new features or security patches are being released, so it is suitable only for stable, self-contained use cases where you can accept the risk of unpatched issues.

Use it for:

  • Validate incoming API request payloads against business rules before processing.
  • Enforce data integrity constraints in microservices that exchange protobuf messages across service boundaries.
  • Catch invalid data early in a data pipeline by validating protocol buffer records before storage.
  • Test that generated protobuf messages conform to schema-defined rules in unit tests.
  • Ensure user input meets semantic requirements when deserializing protobuf from untrusted sources.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Validates protocol buffer messages against semantic rules defined in protobuf schema annotations, enforcing constraints that go beyond type checking.

Yes, with conditions. The package solves a real problem—runtime semantic validation of protobuf messages—and has low install friction and no known vulnerabilities. However, the repository is archived and abandoned, so install only if you are comfortable maintaining a frozen dependency or if your validation rules are stable and unlikely to need updates. Verify the license terms before use in commercial contexts.

Install

protoc-gen-validate on PyPI

pip

pip install protoc-gen-validate

uv

uv add protoc-gen-validate

poetry

poetry add protoc-gen-validate

Installing protoc-gen-validate

Before you install

Low install friction with pure Python wheels. Repository is archived and marked abandoned as of the last commit in 2026-05-27, with no active maintenance—use only if you accept the risk of unpatched issues.

License in practice

License status is unclear; no SPDX identifier or raw license text is available. Verify the actual license terms before depending on this package in commercial or restricted contexts.

Quickstart

pip install protoc-gen-validate

from protoc_gen_validate.validator import validate, ValidationFailed

try:
    validate(message)
except ValidationFailed as err:
    print(err)

Requires Python 3.10 or later; protobuf messages must be generated with validation annotations in the schema.

Verify before relying

  • Which protobuf validation rules from validate.proto are actually implemented in this Python version
  • Whether the abandoned status affects compatibility with current protobuf library versions
  • Actual license terms and attribution requirements for the package

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — Jinja2, protobuf, validate-email
Maintenance abandoned — 177 days since the last release
Last repo commit (repository archived)
First released
Downloads 208,130/month — #9,535 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: protoc_gen_validate-1.3.3-py3-none-any.whl

Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

protobuf message validationprotoc-gen-validate pythonsemantic validation protobufruntime protobuf constraintspgv python implementationprotobuf schema rules enforcement
protobufvalidationdata-integrity

More Quality Assurance packages