--- id: colander version: "2.0" license: BSD-derived (http://www.repoze.org/LICENSE.txt) license_treatment: permissive maintenance: active --- # colander — A simple schema-based serialization and deserialization library License: permissive · Maintenance: active · Downloads: 240.2K/mo ## What it is and what it does Colander is a schema-based serialization and deserialization library that converts between Python data structures and flat representations (strings, mappings, lists). It lets you define schemas declaratively—specifying types, validators, and transformations—then use them to validate incoming data and convert outgoing data to a serializable form. The package is designed for web frameworks and APIs where you need to validate user input (form data, JSON payloads) and ensure it matches an expected structure before processing. It handles type coercion, custom validation logic, nested structures, and error reporting. With only two runtime dependencies and support for Python 3.7 and later, it integrates easily into most projects. Use it for: - Validate and deserialize JSON or form data in web applications before passing it to business logic. - Define and enforce data schemas for REST API request and response bodies. - Serialize Python objects to JSON-safe dictionaries for API responses or storage. - Build custom validators for domain-specific constraints (email, URL, date ranges, enums). - Coerce and normalize user input (strings to integers, dates, etc.) with clear error messages. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Colander deserializes and validates data structures composed of strings, mappings, and lists, and serializes arbitrary data structures back to those primitive types using extensible schema definitions. Yes. Colander is a mature, actively maintained library with low install friction, no known vulnerabilities, and a permissive license. It solves a common problem—validating and serializing structured data—with a clean, extensible API. Install it if you need schema-based validation and serialization in a web framework or data-processing pipeline. ## Install pip install colander uv add colander poetry add colander ## Installing colander Before you install: Low install friction with only two runtime dependencies (translationstring and iso8601). The package is actively maintained with recent commits and supports Python 3.7, 3.8, 3.9, 3.10, 3.11, and PyPy 3.8. License in practice: Licensed under a BSD-derived permissive license (Repoze Public License), which permits commercial and private use with minimal restrictions. Quickstart: pip install colander import colander class PersonSchema(colander.MappingSchema): name = colander.SchemaNode(colander.String()) age = colander.SchemaNode(colander.Integer()) schema = PersonSchema() data = schema.deserialize({'name': 'Alice', 'age': 'value'}) print(schema.serialize(data)) Verify before relying: - Whether the package's locale data and internationalization support covers all languages relevant to your use case. - Performance characteristics when validating deeply nested or very large data structures. ## Package facts - License: BSD-derived (http://www.repoze.org/LICENSE.txt) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 240.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags schema validation and serialization, data deserialization library, validate structured data, serialize deserialize python, schema-based data validation, mapping list string validation, data structure validation, schema-validation, serialization, data-validation [View on SkillFed](https://skillfed.io/packages/colander) · [View on PyPI](https://pypi.org/project/colander/)