$ show python-jsonschema/jsonschema
This is a mature, production-grade Python library implementing JSON Schema validation across multiple drafts (3, 4, 6, 7, 2019-09, 2020-12, and a v1 proposal). It provides a clean API with versioned validator classes (e.g., Draft202012Validator), a simple validate() function, and a deprecated CLI. The architecture is modular, separating core validation logic in _keywords.py, type checking in _types.py, format validation in _format.py, and utilities in _utils.py. It relies on the external `referencing` library for $ref resolution and uses `attrs` for class definitions. The library is thoroughly tested against the official JSON Schema Test Suite, includes performance benchmarks, and supports customization via validator creation/extension patterns. It requires Python >=3.12 and is actively maintained with CI covering Python 3.12-3.15 and PyPy. The codebase exhibits strong engineering practices: immutability, protocol-based interfaces, clear deprecation warnings, and comprehensive error handling.
The LLM identified 1 files worth highlighting for reuse:
Contains two self-contained utility functions: `equal` and `uniq`. `equal` performs structural equality comparison with correct handling of NaN (NaN == NaN), Boolean vs integer distinction (True != 1), and unhashable types. `uniq` removes duplicate elements based on custom equality semantics. Both functions are isolated (only depend on standard library collections.abc), well-commented, and can be reused in any project needing robust JSON-like equality or deduplication.