Pycerberus

Latest version: v0.6

Safety actively analyzes 620848 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.7dev

====================

pycerberus validators can now return validation errors as result values
instead of raising exceptions. This change enables a number of interesting
features on top of pycerberus e.g. returning multiple errors for a single
field (and ignoring errors), retrieval of "partial" conversions and formvalidators
being run even if some fields of a schema are invalid.

Currently both ways are supported (Schema even supports mixing both) but
I will migrate all built-in validators to the new schema in the future
and version 1.0 will use result instances by default.

- bug fix: email address validator now complains if the domain part is missing
completely
- IntegerValidator now implements "revert_conversion()" properly
- BooleanCheckbox: can set trueish/falsish values at initialization
- BooleanCheckbox: support arbitrary data types for trueish/falsish
- BaseValidator: removed deprecated ".error()" and ".to_string()" methods

0.6

====================
- stop using 2to3 for Python 3 compatibility and use exactly the same source
for all Python versions.
- drop support for Python 2.4 and 2.5
- bug fix: detect validator message keys correctly also when messages are
specified during validator initialization

0.5

====================
- 'allow_additional_parameters' can now be specified in the schema constructor
directly as well as a parameter for a declarative schema
- new ForEach validator to validate a list of items with the same validator
- InvalidDataErrors can return a list of errors using '.errors()'.
- added 'min_length', 'max_length' parameters when instantiating a
StringValidator
- All validator messages can be overridden during instantiation by specifying
``messages`` attribute,
- new OneOf validator to validate that a value is in a given list of allowed
values
- added constructor parameter 'filter_unvalidated_parameters' (default True)
for SchemaValidators to pass unvalidated parameters instead of removing them
- InvalidDataErrors can "unpack" their errors so that an ordinary dict is used
as container for sub-errors (instead of another InvalidDataError with an
error_dict)
- new BooleanCheckbox validator to validate typical HTML checkboxes
- new API method for all validators: '.copy()' returns a clone of the validator
- new MatchingFields form validator (typically used to verify a password
confirmation field)
- new AgreeToConditionsCheckbox validator which works like a BooleanCheckbox
but enforces a trueish value
- EmailAddressValidator accepts also '-' and '+' characters in local part

API changes:
------------
- BaseValidator.error() is deprecated now as the name does not really reflect
that the method also raised the exception. I added a new method named
'.raise_error()' which behaves exactly like the old .error() method. In
addition there is a new method '.exception()' which only creates an exception
instance.
- IntegerValidator now treats '' and None as empty
- BaseValidator.to_string() changed to BaseValidator.revert_conversion()
which reflects the actual purpose better. Validators are not required to
return a string anymore.

0.4.2

====================
- More fixes for source distribution because of missing files in tar.gz

0.4.1

====================
- Fix source distribution (distribution_helpers.py were not included)

0.4

====================
- pycerberus now supports Python 3!
- Fix installation/egg generation without babel
- Added a schema which can parse positional parameters from a string into a
dict before processing the data like a normal schema would do

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.