warlock
Python object model built on JSON schema and JSON patch.
Decision gist · record as of 2026-08-14
Yes, if you need runtime validation and change tracking for Python objects. The package is stable, has no known vulnerabilities, and low install friction. The aging maintenance (441 days since last release) is a minor concern but not a blocker given the Production/Stable status and active repository. Install it for schema-driven model validation; avoid it if you prefer external validation frameworks or don't need JSON Patch tracking.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure-Python wheel and only two lightweight dependencies (jsonschema and jsonpatch).
- Maintenance is aging—last release was 441 days ago—but the repository is not archived and the package is marked Production/Stable.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
last release 2025-05-30 (441 days) · last repo commit 2025-05-30 · 150 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 372,321 downloads/mo, #7,163 on PyPI
Alternatives
Verify before relying
pip install warlock
import warlock
schema = {
'name': 'Country',
'properties': {
'name': {'type': 'string'},
'population': {'type': 'integer'},
},
'additionalProperties': False,
}
Country = warlock.model_factory(schema)
sweden = Country(name='Sweden', population=9453000)
sweden.patch # '[{"path": "/population", "value": 9453000, "op": "add"}]'- Whether the aging maintenance status (441 days since last release) affects compatibility with the latest Python minor versions despite classifier support for 3.9–3.13
- Performance characteristics when validating large object graphs or high-frequency attribute updates
What it is and what it does
Warlock is a Python library that generates model classes from JSON schemas, binding validation logic directly to object instances. When you define a schema and use warlock.model_factory() to create a class, instances of that class automatically validate all attribute assignments against the schema constraints—rejecting invalid types, disallowing undeclared properties (if additionalProperties is false), and raising InvalidOperation exceptions on violations.
The library integrates jsonschema for validation and jsonpatch for change tracking. Every mutation to a validated object is recorded, and you can retrieve a JSON Patch document describing all changes since the object was created. This makes warlock useful for scenarios where you need runtime type safety, audit trails of object modifications, or serializable representations of state changes.
Use it for
- Build domain models with automatic type enforcement, catching invalid assignments at runtime instead of downstream
- Track object mutations as JSON Patch documents for audit logs, change notifications, or state synchronization
- Validate API request/response payloads by wrapping them in schema-backed models before processing
- Generate model classes dynamically from external JSON schema definitions without hand-coding validators
- Enforce data contracts in collaborative systems where multiple components share the same schema definition
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need runtime validation and change tracking for Python objects.
The package is stable, has no known vulnerabilities, and low install friction. The aging maintenance (441 days since last release) is a minor concern but not a blocker given the Production/Stable status and active repository. Install it for schema-driven model validation; avoid it if you prefer external validation frameworks or don't need JSON Patch tracking.
Install
warlock on PyPI
Before you install
Low install friction with a pure-Python wheel and only two lightweight dependencies (jsonschema and jsonpatch). Maintenance is aging—last release was 441 days ago—but the repository is not archived and the package is marked Production/Stable.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install warlock
import warlock
schema = {
'name': 'Country',
'properties': {
'name': {'type': 'string'},
'population': {'type': 'integer'},
},
'additionalProperties': False,
}
Country = warlock.model_factory(schema)
sweden = Country(name='Sweden', population=9453000)
sweden.patch # '[{"path": "/population", "value": 9453000, "op": "add"}]'
Verify before relying
- Whether the aging maintenance status (441 days since last release) affects compatibility with the latest Python minor versions despite classifier support for 3.9–3.13
- Performance characteristics when validating large object graphs or high-frequency attribute updates
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesjsonschemajsonpatch |
| Maintenance | Aging 441 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 372,321 / month, #7,163 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: warlock-2.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “self-validating python objects”
- warlockWarlock creates self-validating Python objects using JSON schema,…
- jsonableProvides an abstract base class for defining Python objects that…
- jsonseqEncodes and decodes JSON text sequences according to RFC 7464,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also schema · pydantic-geojson · pykwalify · genson · drf-jsonschema-serializer · jsonschema-pydantic · jsonpointer · django-mock-queries · zcbor · marshmallow-jsonschema