Metadata-Version: 2.1
Name: protoc-gen-validate
Version: 0.4.1
Summary: PGV for python via just-in-time code generation
Home-page: https://github.com/envoyproxy/protoc-gen-validate
Author: Envoyproxy
Author-email: dev@lyft.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: ipaddress (>=1.0.22)
Requires-Dist: validate-email (>=1.3)
Requires-Dist: Jinja2 (>=2.11.1)
Requires-Dist: protobuf (>=3.6.1)

# Protoc-gen-validate (PGV)
While protocol buffers effectively guarantee the types of structured data, 
they cannot enforce semantic rules for values. This package is a python implementation
of [protoc-gen-validate][pgv-home], which allows for runtime validation of various 
semantic assertions expressed as annotations on the protobuf schema. The syntax for all available annotations is
in `validate.proto`. Implemented Python annotations are listed in the [rules comparison][rules-comparison].

### Example
```python3
from entities_pb2 import Person
from protoc_gen_validate.validator import validate, ValidationFailed

p = Person(first_name="Foo", last_name="Bar", age=42)
try:
    validate(p)
except ValidationFailed as err:
    print(err)
```

[pgv-home]: https://github.com/envoyproxy/protoc-gen-validate
[rules-comparison]: https://github.com/envoyproxy/protoc-gen-validate/blob/main/rule_comparison.md

