Trafaret

Latest version: v2.1.1

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

Scan your dependencies

Page 1 of 2

2.1.0

=====
- fix for `Dict` merge
- new `is_valid` method

2.0.2

=====
- construct for `int` and `float` will use `ToInt` and `ToFloat`

2.0.1

------

* Package metadata update only

2.0.0

-----

- ``WithRepr`` – use it to return custom representation, like ``<Email>``
- Strip a lot from dict, like ``keys()``
- Trafarets are not mutable
- DataError has new ``code`` attribute, self.failure has ``code`` argument
- OnError has ``code`` argument too
- New ``DataError.to_struct`` method that returns errors in more consistent way
- ``String``, ``AnyString``, ``Bytes``, ``FromBytes(encoding=utf-8)``
- ``Int``, ``ToInt``, ``Float``, ``ToFloat``
- ``ToDecimal``
- ``Iterable`` that acts like a ``List``, but works with any iterable
- New ``Date``, ``ToDate`` and ``DateTime``, ``ToDateTime`` trafarets
- ``StrBool`` trafaret renamed to ``ToBool``
- ``Visitor`` trafaret was deleted
- Test coverage

1.0.3

-----
- new ``trafaret.keys`` dict key ``subdict`` from ``trafaret_schema``

1.0.1

-----
- ``Date`` catches ``TypeError`` in cases like ``None``

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.