NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3384 most downloaded on PyPI
Protocol Buffer Validation for Python
Last release 1 months ago
19 Aug 2026
Release timing varies
gaps range from 8 days to 4 months
Nearly every release is documented
notes for 26 of 26 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
26 releases · first in 2023
One column per quarter.
…friends protobuf-py and connect-py. There are breaking changes in this release. Read on for more details.
This release targets protovalidate 1.2.0.
This is a huge release, marked by our first major version bump to v2 and a repository rename to protovalidate-py to match our new friends protobuf-py and connect-py. There are breaking changes in this release. Read on for more details.
protovalidate-py is now a native Python extension, wrapping the implementation from protovalidate-cc while still providing a Python-native experience. Performance has been commonly brought up as an issue using protovalidate, and we hope finally we can give you performance you can be comfortable with. Many operations will be hundreds of times faster, with one of our benchmarks even showing a 800x improvement. Yes... we're sorry it took so long to address this but going forward performance is a high priority for this project. This is not the end and we have more ideas to improve even further, stay tuned.
Going native should not mean users need to build the library - we publish wheels for Linux (glibc and musl), macOS, and Windows, on amd64 and arm64. By using the Python stable ABI, they are always compatible with any version of Python 3, including the next one. In fact, this is wider compatibility then previously where our hard dependency on re2, itself a native library, would cause some lag after a new Python version. We believe this means almost all users will download the prebuilt wheel and use it just like the pure Python version, and for users that use a different platform, you only need Rust and C++ compilers installed for uv or pip to automatically build the extension (as a large amount of C++ code, it will take some time though).
With this release, we have migrated our base protobuf implementation from google.protobuf to protobuf-py. This primarily means our public API returns Validation protos as protobuf-py messages instead of google.protobuf. Validating google.protobuf messages is still 100% supported, and we have no plan to ever lose that. You can still pass them to the same validation APIs with no change. We don't have a dependency declaration anymore on the protobuf package - if you happened to be pulling it in transitively via protovalidate, you will need to add protobuf directly to your project.
Validation.proto has changed to return a protobuf-py message, read-only access is similar to before, but inner messages can be None instead of automatically instantiated to an empty message. Also, if you marshal the violation protobuf, perhaps to log as JSON in a log message, you will need to update to the protobuf-py idiom for it.
Before:
for violation in validator.collect_violations(message):
print(violation.proto.rule_id)
for element in validation.proto.field.elements:
print(element)
print(MessageToJson(violation.proto))After:
for violation in validator.collect_violations(message):
print(violation.proto.rule_id)
if field := validation.proto.field:
for element in field.elements:
print(element)
print(violation.proto.to_json())protovalidate now vendors gencode for buf.validate protos, meaning the library itself does not require a user to "bring their protos". This is made possible because protobuf-py does not have a global singleton that causes conflicts when multiple libraries vendor the same proto.
This does not yet solve the issue that users must bring in buf.validate as a dependency for their own protos - we are still working on support for this in protobuf-py. Until that is solved, we continue to recommend using include_imports when you generate your protos. When using protobuf-py, this has no risk of process crash so should be safe in almost all cases. We understand that when using multiple packages that do this, it can result in bloated generated code - solving the underlying issue for imports so you can depend on a package for buf.validate continues to be important to us to fix.
Full Changelog: v1.2.0...v2.0.0
This release is compatible with the v1.2.0 release of Protovalidate.
This release is compatible with the v1.2.0 release of Protovalidate.
v1.2.0 by @srikrsna-buf in #457Full Changelog: v1.1.2...v1.2.0
This release fixes support for protobuf==7 , the latest major release of the protobuf runtime library.
This release fixes support for protobuf==7, the latest major release of the protobuf runtime library.
Full Changelog: v1.1.1...v1.1.2
The biggest change in this release is bumping cel-python to 0.5.0 (see #414 ), which should improve performance.
The biggest change in this release is bumping cel-python to 0.5.0 (see #414), which should improve performance.
Full Changelog: v1.1.0...v1.1.1
This release is compatible with the v1.1.0 release of Protovalidate.
This release is compatible with the v1.1.0 release of Protovalidate.
Full Changelog: v1.0.0...v1.1.0
After two years of development, Protovalidate has reached v1.0, marking our commitment to stability and production readiness. Read more in our blog po
After two years of development, Protovalidate has reached v1.0, marking our commitment to stability and production readiness.
Read more in our blog post. Get started at https://protovalidate.com.
There are no functional changes compared to the previous release.
Full Changelog: v0.15.0...v1.0.0
Another day, another release — this time, moving to v0.15.0 as we've bundled a couple of breaking changes into one release (we hope these are the last…
Another day, another release — this time, moving to v0.15.0 as we've bundled a couple of breaking changes into one release (we hope these are the last for awhile)!
protovalidate.Config class (#364)
fail_fast kwarg to either validate or collect_validationscollect_validations(..., into=) argument (#365)
google-re2 a required dependency (#363)
re2 extra that was added in v0.14.0. google-re2 supplies wheels for all supported versions of Python, so this shouldn't be an issue, but please let us know if you have issues!google-re2 required dependency by @stefanvanburen in #363Full Changelog: v0.14.1...v0.15.0
This release fixes a bug with concatenated values ( #354 + #357 ), and adds back support for protobuf==5 ( #358 ). We plan to support protobuf==5 unti
This release fixes a bug with concatenated values (#354 + #357), and adds back support for protobuf==5 (#358). We plan to support protobuf==5 until protobuf==7 is released.
buf format to Makefile format target by @stefanvanburen in #348isinstance call in extra_func.py by @engnatha in #357Full Changelog: v0.14.0...v0.14.1
Config option for custom regex removed
We have removed the regex_matches_func from the config. Now that google-re2 has pre-built binaries for Python 3.13, re2 can be fully supported inside protovalidate-python. Users no longer need to bring-their-own-re2.
To use re2 syntax, install protovalidate-python with an extra dependency on re2 as follows:
pip install protovalidate[re2]For more context, see PR #346
This release is compatible with protovalidate v0.14.0.
Full Changelog: v0.13.0...v0.14.0
To simplify Protovalidate, we are renaming an option and remove two others. This is a breaking change, and you will have to update your Protobuf files…
This release is compatible with the v0.14.0 release of Protovalidate.
We want validation rules to be easy to understand for authors and consumers. To simplify Protovalidate, we are renaming an option and remove two others. This is a breaking change, and you will have to update your Protobuf files if they use the relevant options :
IGNORE_IF_UNPOPULATED is renamed to IGNORE_IF_ZERO_VALUE.(buf.validate.message).disabled is removed.IGNORE_ALWAYS to every field of the message. See bufbuild/protovalidate#394 for details.IGNORE_IF_DEFAULT_VALUE is removed.IGNORE_IF_ZERO_VALUE. See bufbuild/protovalidate#396 for details.Full Changelog: v0.12.0...v0.13.0
Users can now specify a Config object when explicitly creating a validator, allowing for configuring validation logic. Currently, the two available op
Users can now specify a Config object when explicitly creating a validator, allowing for configuring validation logic. Currently, the two available options are:
fail_fast (bool): If True, validation stops after the first failure.
regex_matches_func (Callable[[str, str], bool): An optional function for overriding this library's matches logic for regular expressions.
Example:
from protovalidate import Config, Validator
cfg = Config(fail_fast=True)
validator = protovalidate.Validator(config=cfg)
validator.validate(msg)
As a result of the above, we have removed the fail_fast parameter from the validate and collect_violations methods on a validator. Users should instead use the above config approach.
Usage of invalid re2 syntax will now throw an evaluation error. While the CEL spec specifies that regular expressions should follow the re2 syntax, the underlying regex engine in protovalidate-python is still Python's re package. This is because there is currently no pre-built binary that supports Python 3.13 (issue).
So, to get as close as possible until then, we are flagging invalid re2 syntax used in regular expressions. Users can also choose to override this and bring their own re2 engine by using the config approach above.
This release is compatible with protovalidate v0.13.3.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.11.0...v0.12.0
Validate MessageOneofRule by @smaye81 in https://github.com/bufbuild/protovalidate-python/pull/320
MessageOneofRule by @smaye81 in https://github.com/bufbuild/protovalidate-python/pull/320IGNORE_IF_UNPOPULATED for MessageOneofRule fields by @srikrsna-buf in https://github.com/bufbuild/protovalidate-python/pull/321This release is compatible with protovalidate v1.0.0-rc.4.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.10.0...v0.11.0
Implement MessageOneofRule by @timostamm in https://github.com/bufbuild/protovalidate-python/pull/317
This release is compatible with protovalidate v1.0.0-rc.2.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.9.0...v0.10.0
As a result, some formatting output may differ from previous versions. See #307 and #308 for details on formatting changes.
As a result, some formatting output may differ from previous versions. See #307 and #308 for details on formatting changes.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.8.0...v0.9.0
protovalidate-python is now conformant with protovalidate v0.11.0, sans current known limitations (higher resolution timestamps/durations, which are n
protovalidate-python is now conformant with protovalidate v0.11.0, sans current known limitations (higher resolution timestamps/durations, which are not currently supported by the CEL implementation.) Various dependencies are also updated.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.7.1...v0.8.0
The biggest change in this release is the upgrade to cel-python 0.2.0, which should help with some of the extraneous logging that users may have notic
The biggest change in this release is the upgrade to cel-python 0.2.0, which should help with some of the extraneous logging that users may have noticed.
--strict_message conformance (minus duration/timestamp) by @stefanvanburen in https://github.com/bufbuild/protovalidate-python/pull/256Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.7.0...v0.7.1
v0.7.0 removes support for the long-deprecated ignore_empty and skipped fields on FieldConstraints; protovalidate-python will no longer respect these…
v0.7.0 removes support for the long-deprecated ignore_empty and skipped fields on FieldConstraints; protovalidate-python will no longer respect these options if they are set, and they are removed from the latest version of the protovalidate definitions.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.6.1...v0.7.0
The biggest change in this release is the support of PEP 561 (marking protovalidate as having type information inline), which should make usage of pro
The biggest change in this release is the support of PEP 561 (marking protovalidate as having type information inline), which should make usage of protovalidate with tools like mypy more seamless — see https://github.com/bufbuild/protovalidate-python/pull/243 for more details. Other than that, it's mostly dependency updates.
If coming from a release pre-v0.6.0, make sure to check out the release notes for that release when upgrading!
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.6.0...v0.6.1
protovalidate.ValidationError has changed. The violations property is now a list of protovalidate.Violation, instead of a protobuf buf.validate.Violat
protovalidate.ValidationError has changed. The violations property is now a list of protovalidate.Violation, instead of a protobuf buf.validate.Violations message. In most cases, code will need to be updated like this:
violations = protovalidate.collect_violations(msg)
- print(violations.violations[0].constraint_id)
+ print(violations[0].proto.constraint_id)
The ValidationError.errors() method is removed in favor of the violations property, and a new ValidationError.to_proto() method is added to return the equivalent buf.validate.Violations.
In addition to containing the buf.validate.Violation protobuf message under the property proto, the new protovalidate.Violation class contains additional in-memory information about the violation which cannot be serialized to the wire:
field_value: Contains the value of the field failing validation, if there is a field corresponding to the violation.rule_value: Contains the value of the rule failing validation, if there is a rule corresponding to the violation.Take, for example, the following protobuf message schema:
message User {
string email = 1 [(buf.validate.field).string.email = true];
}
If you try to validate the message User(email="invalid"), the field_value will be "invalid" and the rule_value will be True.
Some violations do not correspond directly to a field, such as a message constraint failure; in these cases, the field_value will be None.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.5.0...v0.6.0
Updates protovalidate to v0.8.1. Note that this is a breaking change. You may need to make some adjustments to your code:
Adds support for custom predefined field constraints. See the protovalidate documentation for more information.
Updates protovalidate to v0.8.1. Note that this is a breaking change. You may need to make some adjustments to your code:
buf.validate.expression_pb2 or buf.validate.priv.private_pb2 should now only import buf.validate.validate_pb2.buf.validate.priv.private_pb2.field was moved to buf.validate.validate_pb2.predefined[!NOTE] This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.4.0...v0.5.0
This release adds support for the string.host_and_port CEL utility function and Protobuf Editions, and bumps the versions of many of the dependencies.
This release adds support for the string.host_and_port CEL utility function and Protobuf Editions, and bumps the versions of many of the dependencies.
[!NOTE] This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
black to ruff format by @stefanvanburen in https://github.com/bufbuild/protovalidate-python/pull/162Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.3.1...v0.4.0
Fix behavior of required + ignore_empty constraints by @rodaine in https://github.com/bufbuild/protovalidate-python/pull/97
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.3.0...v0.3.1
Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/bufbuild/protovalidate-python/pull/71
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.2.1...v0.3.0
Upgrade to v0.4.2 by @elliotmjackson in https://github.com/bufbuild/protovalidate-python/pull/65
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.2.0...v0.2.1
In the recent changes to `buf/validate/validate.proto`, we've refactored message definitions, targeting the organization and enforcement of rules with
In the recent changes to buf/validate/validate.proto, we've refactored message definitions, targeting the organization and enforcement of rules within number-centric messages like FloatRules, DoubleRules, Int32Rules, and others.
Fields such as gt, gte, lt, and lte have been structured within a oneof to ensure exclusivity:
- Fields associated with lt and lte now reside within the less_than oneof.
- Fields linked to gt and gte have transitioned to the greater_than oneof.
Additionally, timestamp and duration fields related to lt_now and gt_now have been assimilated into their respective less_than and greater_than oneof categories.
To ensure seamless compatibility and functionality, users must update their protobuf dependencies and package concurrently with this release. If your protos were designed with mutually exclusive rules initially, the impact of this change should be minimal.
The restructure aims to make the rule application process more intuitive, thereby eliminating ambiguities and overlaps present in the earlier configuration. This approach ensures that rules are naturally exclusive, reinforcing better design practices.
Full Changelog: https://github.com/bufbuild/protovalidate-python/compare/v0.1.0...v0.2.0
We are excited to introduce protovalidate-python v0.1.0, the Python implementation of protovalidate, providing runtime validation for Protobuf message
We are excited to introduce protovalidate-python v0.1.0, the Python implementation of protovalidate, providing runtime validation for Protobuf messages based on user-defined constraints, powered by Google's Common Expression Language (CEL).
Refer to our official documentation for detailed instructions. For any issues or suggestions, please open an issue on our GitHub page. Stay tuned for future updates.
Full Changelog: https://github.com/bufbuild/protovalidate-python/commits/v0.1.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →