Schemable

Latest version: v0.5.0

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

Scan your dependencies

Page 1 of 2

0.5.0

-------------------

- Don't load partial data from a nested schema if it was created with ``strict=True`` (e.g. ``Schema({'key': Schema({...}, strict=True)})``).

0.4.1

-------------------

- Fix previous fix for case where schema results could have ``data`` or ``errors`` with schema classes as keys.
- Ensure that ``Select('key', <iteratee>)`` doesn't call ``<iteratee>`` if ``'key'`` was not found in the source data.

0.4.0

-------------------

- Fix case where schema object with an ``Optional(key)`` would result in ``SchemaResult.errors[Optional(key)]``. Ensure that ``SchemaResult.errors[key]`` is set instead.
- Ignore ``KeyError`` when using ``Schema({'key': Select('other_key')})`` when ``'other_key'`` isn't present in the source object. Return a missing key error instead.

0.3.1

-------------------

- If a validate callable raises an exception, use its string representation as the schema error message. Previously, a custom error message stating that the callable should evaluate to true was used when validator returned falsey and when it raised an exception. That message is now only returned when the validator doesn't raise but returns falsey.

0.3.0

-------------------

- Add schema helpers:

- ``Select``
- ``Use``

- Include execption class name in error message returned by ``As``.
- Always return a ``dict`` when parsing from dictionary schemas instead of trying to use the source data's type as an initializer. (**breaking change**)

0.2.0

-------------------

- Rename ``Collection`` to ``List``. (**breaking change**)
- Rename ``Object`` to ``Dict``. (**breaking change**)
- Allow ``collections.abc.Mapping`` objects to be valid ``Dict`` objects.
- Modify ``Type`` validation so that objects are only compared with ``isinstance``.
- Improve docs.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.