Welcome to Cerberus¶
CERBERUS
, n. The watch-dog of Hades, whose duty it was to guard the entrance; everybody, sooner or later, had to go there, and nobody wanted to carry off the entrance. - Ambrose Bierce, The Devil’s Dictionary
Cerberus provides powerful yet simple and lightweight data validation functionality out of the box and is designed to be easily extensible, allowing for custom validation. It has no dependencies and is thoroughly tested from Python 2.7 up to 3.8, PyPy and PyPy3.
At a Glance¶
You define a validation schema and pass it to an instance of the
Validator
class:
>>> schema = {'name': {'type': 'string'}}
>>> v = Validator(schema)
Then you simply invoke the validate()
to validate
a dictionary against the schema. If validation succeeds, True
is returned:
>>> document = {'name': 'john doe'}
>>> v.validate(document)
True
Funding Cerberus¶
Cerberus is a collaboratively funded project. If you run a business and are using Cerberus in a revenue-generating product, it would make business sense to sponsor its development: it ensures the project that your product relies on stays healthy and actively maintained.
Individual users are also welcome to make either a recurring pledge or a one time donation if Cerberus has helped you in your work or personal projects. Every single sign-up makes a significant impact towards making Cerberus possible.
To join the backer ranks, check out Cerberus campaign on Patreon.
Table of Contents¶
- Installation
- Usage
- Validation Schemas
- Validation Rules
- Normalization Rules
- Errors & Error Handling
- Extending
- Custom Rules
- Custom Data Types
- Methods that can be referenced by the check_with rule
- Custom Coercers
- Custom Default Setters
- Limitations
- Attaching Configuration Data And Instantiating Custom Validators
- Relevant Validator-attributes
- Validator.document
- Validator.schema
- Validator._error
- Validator._get_child_validator
- Validator.root_document, .root_schema, .root_allow_unknown & .root_require_all
- Validator.document_path & Validator.schema_path
- Validator.recent_error
- Validator.mandatory_validations, Validator.priority_validations & Validator._remaining_rules
- Contributing
- Funding
- API
- FAQ
- External resources
- Cerberus Changelog
- Version 1.3.4
- Version 1.3.3
- Version 1.3.2
- Version 1.3.1
- Version 1.3
- Version 1.2
- Version 1.1
- Version 1.0.1
- Version 1.0
- Version 0.9.2
- Version 0.9.1
- Version 0.9
- Version 0.8.1
- Version 0.8
- Version 0.7.2
- Version 0.7.1
- Version 0.7
- Version 0.6
- Version 0.5
- Version 0.4.0
- Version 0.3.0
- Version 0.2.0
- Version 0.1.0
- Version 0.0.3
- Version 0.0.2
- Version 0.0.1
- Upgrading to Cerberus 1.0
- Authors
- Contact
- License
Copyright Notice¶
Cerberus is an open source project by Nicola Iarocci. See the original LICENSE for more information.