Skip to main content

Schema Tools

Collection of tools to parse, query, map,... Json/Yaml schemas

PyPI version Python versions License CI Code style: ruff Type checked: mypy Documentation Status Coverage Status Agentic

Schema Tools is a collection of utilities to load, parse, query, dereference and map Json and Yaml schemas, with support for UBL / Schematron / PEPPOL document validation on top. It ships a CLI (schema-tools) and an optional web-based schema viewer.

Features

  • (loading of) Json and Yaml schemas with line/column-preserving Abstract Syntax Tree access
  • a schema-oriented object model with $ref resolving, dereferencing and mapping
  • selection, dependency extraction and round-trip (de)serialization
  • UBL document validation (XSD + Schematron) with PEPPOL billing rules

Installation

Using pip:

pip install schema-tools

Using uv:

uv add schema-tools

Quick Start

>>> from schema_tools import json
>>> j = json.loads('''{
...   "hello" : "world",
...   "count" : [ 1, 2, 3 ]
... }''')
>>> j
ObjectNode(len=2, line=1, column=1)
>>> j()
{'hello': 'world', 'count': [1, 2, 3]}

Documentation

Full documentation available at schema-tools.readthedocs.io.

Development

make env-dev    # Install all dependencies
make test       # Run tests
make lint       # Run linter
make typecheck  # Run type checker
make check      # Run all quality checks
make docs       # Build documentation

License

MIT License - see LICENSE for details.

Metadata

Release files for schema-tools 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schema-tools 0.4.0
File Size Uploaded
schema_tools-0.4.0.tar.gz 498.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for schema-tools 0.4.0
File Interpreter ABI Platform
schema_tools-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / schema_tools-0.4.0.tar.gz

Download URL schema_tools-0.4.0.tar.gz
Size 498.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3a3120d1dd20243114d38511be9cc9a21185fbe3dfb0efb4bbec117f19646b31
BLAKE2b-256 checksum
How to use checksums
3b2d6b1c82cc9693eea295f841fb4dd0631b4fc223d448e5a0a11f5ca4a3f4d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / schema_tools-0.4.0-py3-none-any.whl

Download URL schema_tools-0.4.0-py3-none-any.whl
Size 546.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44dd6c4b1a591041074ce8b4243265c31f7d5faff64fec8c9dcfd92a1337305d
BLAKE2b-256 checksum
How to use checksums
3e0d30fcae5cb001e29af51899bbb2fcb405080a986f7161785420bb0caa9f00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page