schematics
Python Data Structures for Humans
What it is and what it does
Schematics is a Python library for building and validating structured data using type definitions. It lets you declare data models with typed fields (like StringType, URLType, etc.), then validate incoming data against those schemas and convert between formats like JSON. The library is modeled after ORM type systems but has no database layer—it stops at data validation and transformation, leaving persistence to you.
Common uses include documenting API input schemas, validating request payloads, serializing objects to JSON or other formats, and filtering fields based on access control. You define a Model class with typed fields, instantiate it with data, call validate() to check constraints, and use to_primitive() to export as a dictionary or JSON.
Use it for:
- Validate API request bodies against a schema before processing them
- Convert between JSON and Python objects with type checking and field filtering
- Define and document message formats for RPC or other communication protocols
- Enforce required fields and data types in configuration or input files
- Serialize domain objects to JSON while hiding fields based on user permissions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Schematics defines, validates, and transforms Python data structures using type-based schemas, with no database layer—useful for API validation, data serialization, and format conversion.
No—the project is abandoned (last release 2021-08-17, no commits since 2023-07-12). While it has low install friction and a permissive license, the lack of maintenance means no bug fixes, security patches, or compatibility updates for modern Python versions. For new projects, use actively maintained alternatives.
Install
schematics on PyPI
pip
pip install schematicsuv
uv add schematicspoetry
poetry add schematicsInstalling schematics
Before you install
Low install friction with no runtime dependencies. However, the project is abandoned—last release was 2021-08-17, with the last commit on 2023-07-12. Maintenance has stopped.
License in practice
BSD license (permissive) means you can use, modify, and distribute the package freely with minimal restrictions, provided you include the license notice.
Quickstart
from schematics.models import Model
from schematics.types import StringType, URLType
class Person(Model):
name = StringType(required=True)
website = URLType()
person = Person({'name': 'Joe', 'website': 'http://example.com'})
person.validate() # raises DataError if invalid
print(person.to_primitive())
Verify before relying
- Whether the package works reliably with Python versions beyond 3.9, given the last release predates newer Python versions
- Whether there are known compatibility issues with modern dependency ecosystems or serialization libraries
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,823 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 638,422/month — #5,619 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: schematics-2.1.1-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
schemaValidates Python data structures (dicts, lists,…
permissive · top 1,000 on PyPI
asdf-transform-schemasProvides ASDF schemas for validating transform…
unclear · top 15,000 on PyPI
trafaretTrafaret validates and transforms foreign data…
permissive · top 5,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
quinnQuinn provides helper methods for PySpark…
permissive · top 15,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI
sentry-kafka-schemasProvides Kafka topic definitions and JSON…
unclear · top 15,000 on PyPI
sparkdanticConverts Pydantic models to PySpark schemas…
unclear · top 5,000 on PyPI
yamaleYamale validates YAML files against a schema…
permissive · top 5,000 on PyPI
bagit-profileValidates BagIt bags against BagIt profile…
permissive · top 15,000 on PyPI