zope.schema
zope.interface extension for defining data schemas
What it is and what it does
zope.schema extends zope.interface to provide a declarative way to define structured data schemas for Python objects. Instead of just describing methods, schemas define the public fields (attributes) of an object, each with a title, description, constraints, and validation logic. A field roughly maps to an object attribute but adds metadata and validation capabilities—you can mark fields as read-only, optional, or required, apply constraints, and define custom validation methods.
The package is used to build self-documenting, validated object models in frameworks that rely on the Zope ecosystem. It provides field types for common data (text, numbers, dates, objects, collections) and allows you to attach invariant validators to schemas to enforce cross-field constraints. The validation framework raises specific exceptions that applications can catch and handle.
Use it for:
- Define validated data models for web frameworks or APIs that need structured input validation and self-documenting schemas.
- Build form generation systems that automatically create HTML forms from schema definitions with validation.
- Enforce object invariants and cross-field constraints in domain models where simple type hints are insufficient.
- Create reusable field libraries for applications that need consistent validation rules across multiple object types.
- Generate documentation or introspection metadata from schema definitions for API clients or configuration systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Defines structured data schemas for Python objects using interface-based field definitions with validation, constraints, and metadata.
Yes, if you are already using the Zope ecosystem or need declarative, interface-based schema validation. The package is stable (Production/Stable status), has no known vulnerabilities, and supports Python 3.9, 3.10, 3.11, 3.12, 3.13. However, the aging maintenance status and unclear license treatment warrant review before adoption in new projects outside the Zope community.
Install
zope-schema on PyPI
pip
pip install zope-schemauv
uv add zope-schemapoetry
poetry add zope-schemaInstalling zope.schema
Before you install
Low install friction with only two runtime dependencies (zope.interface and zope.event). Maintenance status is aging—last release was 292 days ago—but the package remains actively supported with recent Python version coverage and no known vulnerabilities.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), which is OSI-approved but less common than MIT or Apache 2.0. The license treatment is marked unclear, so review the full license terms before use in proprietary or copyleft-sensitive projects.
Quickstart
from zope.schema import TextLine, Int, Object
from zope.interface import Interface
class IPerson(Interface):
name = TextLine(title="Name", required=True)
age = Int(title="Age")
Requires Python 3.9 or later; zope.interface and zope.event must be installed as runtime dependencies.
Verify before relying
- Whether the package is actively maintained or in long-term support mode given the 292-day gap since last release.
- Performance characteristics when validating large or deeply nested object hierarchies.
- Compatibility with modern async frameworks or whether it is synchronous-only.
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — zope.interface, zope.event |
| Maintenance | aging — 292 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 994,582/month — #4,552 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_schema-8.1-py3-none-any.whl
Keywords: zope3, schema, field, interface, typing
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
zope.interfaceProvides a Python implementation of object…
unclear · top 1,000 on PyPI
mypy-zopeA mypy plugin that treats zope.interface…
permissive · top 15,000 on PyPI
zope.configurationZope.configuration provides an extensible…
unclear · top 5,000 on PyPI
zope.componentImplements the core Zope Component Architecture…
unclear · top 5,000 on PyPI
zope.proxyzope.proxy provides transparent wrapper objects…
unclear · top 15,000 on PyPI
zope.securityProvides a generic security framework for…
unclear · top 15,000 on PyPI
ZConfigZConfig is a schema-driven configuration…
unclear · top 15,000 on PyPI
zope.annotationStores additional metadata on objects without…
unclear · top 15,000 on PyPI
zope.filerepresentationDefines interfaces for representing objects as…
unclear · top 15,000 on PyPI
ZopeZope is an open-source web application server…
unclear · top 15,000 on PyPI