Colander

Latest version: v2.0

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

Scan your dependencies

Page 3 of 8

1.3.1

Not secure
==================

- 1.3 was released without updating the changelog. This release fixes that.

1.3

Not secure
================

- Drop Python 2.6 and PyPy3 from the test suite. They are no longer
supported. See https://github.com/Pylons/colander/pull/263

- ``colander.String`` schema type now supports an optional keyword argument
``allow_empty`` which, when True, deserializes an empty string to an
empty string. When False (default), an empty string deserializes to
``colander.null``. This allows for a node to be explicitly required, but
allow an empty ('') value to be provided.
https://github.com/Pylons/colander/pull/199

- Add ``separator`` parameter to ``colander.Invalid.asdict``
(for backward compatibility, default is '; ').
See https://github.com/Pylons/colander/pull/253

- Fixed an issue with ``SchemaNode.clone`` where it would fail when
cloning an instance of ``colander.SequenceSchema`` due to initializing
the schema without any children, violating some checks.
See https://github.com/Pylons/colander/pull/212

1.2

Not secure
================

Features
--------

- Add new exception ``UnsupportedFields``. Used to pass to the caller a list
of extra fields detected in a cstruct during deserialize.
See https://github.com/Pylons/colander/pull/241

- Add ``drop`` functionality to ``Sequence`` type.
See https://github.com/Pylons/colander/pull/225

Bug Fixes
---------

- ``SchemaNode`` will no longer assume the first argument to the constructor
is the schema type. This allows it to properly fallback to using the
``schema_type`` class attribute on subclasses even when using the
imperative API to pass options to the constructor.

- Fix a bug in which ``MappingSchema``, ``SequenceSchema`` and
``TupleSchema`` would always treat the first arg as the schema type. This
meant that it would fail if passed only nodes to the constructor despite
the default type being implied by the name. It is now possible to do
``MappingSchema(child1, child2, ...)`` instead of
``MappingSchema(Mapping(), child1, child2)``.

Translations
------------

- Added Finnish translations: ``fi``
See https://github.com/Pylons/colander/pull/243

1.1

Not secure
================

Platform
--------

- Add explicit support for Python 3.4, Python 3.5 and PyPy3.

Features
--------

- Add ``min_err`` and ``max_err`` arguments to ``Length``, allowing
customization of its error messages.

- Add ``colander.Any`` validator: succeeds if at least one of its
subvalidators succeeded.

- Allow localization of error messages returned by ``colander.Invalid.asdict``
by adding an optional ``translate`` callable argument.

- Add a ``missing_msg`` argument to ``SchemaNode``, allowing customization
of the error message used when the node is required and missing.

- Add ``NoneOf`` validator which succeeds if the value is none of the choices.

- Add ``normalize`` option to ``Decimal``, stripping the rightmost
trailing zeros.

Bug Fixes
---------

- Fix an issue where the ``flatten()`` method produces an invalid name
(ex: "answer.0.") for the type ``Sequence``. See
https://github.com/Pylons/colander/issues/179

- Fixed issue with ``String`` not being properly encoded when non-string
values were passed into ``serialize()``
See `235 <https://github.com/Pylons/colander/pull/235>`_

- ``title`` was being overwritten when made a child through defining a schema
as a class. See https://github.com/Pylons/colander/pull/239

Translations
------------

- Added new translations: ``el``

- Updated translations: ``fr``, ``de``, ``ja``

1.0

Not secure
================

Backwards Incompatibilities
---------------------------

- ``SchemaNode.deserialize`` will now raise an
``UnboundDeferredError`` if the node has an unbound deferred
validator. Previously, deferred validators were silently ignored.
See https://github.com/Pylons/colander/issues/47

Bug Fixes
---------

- Removed forked ``iso8601`` and change to dependency on PyPI ``iso8601``
(due to float rounding bug on microsecond portion when parsing
iso8601 datetime string). Left an ``iso8601.py`` stub for backwards
compatibility.

- Time of "00:00" no longer gives ``colander.Invalid``.

- Un-break wrapping of callable instances as ``colander.deferred``.
See https://github.com/Pylons/colander/issues/141.

- Set the max length TLD to 22 in ``Email`` validator based on the
current list of valid TLDs.
See https://github.com/Pylons/colander/issues/159

- Fix an issue where ``drop`` was not recognized as a default and was
returning the ``drop`` instance instead of omitting the value.
https://github.com/Pylons/colander/issues/139

- Fix an issue where the ``SchemaNode.title`` was clobbered by the ``name``
when defined as a class attribute.
See https://github.com/Pylons/colander/pull/183 and
https://github.com/Pylons/colander/pull/185

Translations
------------

- Updated translations: ``fr``, ``de``, ``ja``

1.0b1

Not secure
==================

Bug Fixes
---------

- In 1.0a1, there was a change merged from
https://github.com/Pylons/colander/pull/73 which made it possible to supply
``None`` as the ``default`` value for a String type, and upon serialization,
the value would be rendered as ``colander.null`` if the default were used.
This confused people who were actually supplying the value ``None`` as a
default when the associated appstruct had no value, so the change has been
reverted. When you supply ``None`` as the ``default`` argument to a String,
the rendered serialize() value will again be ``'None'``. Sorry.

- Normalize ``colander.Function`` argument ``message`` to be ``msg``. This now
matches other APIs within Colander. The ``message`` argument is now
deprecated and a warning will be emitted.
https://github.com/Pylons/colander/issues/31
https://github.com/Pylons/colander/issues/64

- ``iso8601.py``: Convert ``ValueError`` (raised by ``datetime``) into
``ParseErrorr`` in ``parse_date``, so that the validation machinery
upstream handles it properly.

- ``iso8601.py``: Correctly parse datetimes with a timezone of Z even
when the default_timezone is set. These previously had the default
timezone.

- ``colander.String`` schema type now raises ``colander.Invalid`` when trying
to deserialize a non-string item.
See https://github.com/Pylons/colander/issues/100

Features
--------

- Add ``colander.List`` type, modeled on ``deform.List``: this type
preserves ordering, and allows duplicates.

- It is now possible to use the value ``colander.drop`` as the ``default``
value for items that are subitems of a mapping. If ``colander.drop`` is used
as the ``default`` for a subnode of a mapping schema, and the mapping
appstruct being serialized does not have a value for that schema node, the
value will be omitted from the serialized mapping. For instance, the
following script, when run would not raise an assertion error::

class What(colander.MappingSchema):
thing = colander.SchemaNode(colander.String(), default=colander.drop)

result = What().serialize({}) no "thing" in mapping
assert result == {}

- The ``typ`` of a ``SchemaNode`` can optionally be pased in as a keyword
argument. See https://github.com/Pylons/colander/issues/90

- Allow interpolation of `missing_msg` with properties `title` and `name`

Page 3 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.