Colander is useful as a system for validating and deserializing data obtained via XML, JSON, an HTML form post or any other equally simple data serialization. It is tested on Python 2.7, 3.3, 3.4, 3.5, and 3.6, and PyPy. Colander can be used to:
- Define a data schema.
- Deserialize a data structure composed of strings, mappings, and lists into an arbitrary Python structure after validating the data structure against a data schema.
- Serialize an arbitrary Python structure to a data structure composed of strings, mappings, and lists.
Colander is a good basis for form generation systems, data description systems, and configuration systems.
Out of the box, Colander can serialize and deserialize various types of objects, including:
- A mapping object (e.g. dictionary).
- A variable-length sequence of objects (each object is of the same type).
- A fixed-length tuple of objects (each object is of a different type).
- A string or Unicode object.
- An integer.
- A float.
- A decimal float.
- A boolean.
- An importable Python object (to a dotted Python object path).
- A Python
- A Python
Colander allows additional data structures to be serialized and deserialized by allowing a developer to define new "types".
The error messages used by Colander's default types are internationalizable.
.. toctree:: :maxdepth: 2 basics.rst null_and_drop.rst extending.rst binding.rst manipulation.rst interfaces.rst api.rst glossary.rst changes.rst