Schema Files

pyTooling ships the schemas of the file formats it writes and reads, so a consumer of such a file can validate it without owning pyTooling. Each schema is listed here with its full source, ready to read, to copy, or to download.

Available schemas

Schema URL prefix: https://pyTooling.GitHub.io/pyTooling/Schemas/***

Schema

Latest Version

Language

Read or Written by

TestReport

v0.1

XML

pyTooling.Testing.ReportWriter

PackageOverrides

v0.1

JSON

pyTooling.Dependency.Python.LicenseOverrides

OTLP-Traces

v1.0

JSON

pyTooling.Tracing.TraceCollection

Schema Versioning

Each schema file has a major and minor version following the format SCHEMANAME-vXX.YY like TestReport-v0.1.

Each schema has a dictionary in SCHEMA_FILES variable, which lists available schema versions and related schema files. In addition, the SCHEMA_VERSION_LATEST variable holds the latest schema version.

Schema file access

The schema files are shipped in the resource package pyTooling.Resources, so a Python program that already depends on pyTooling can directly access the schema file or its content.

Schema Path

from pathlib                        import Path
from pyTooling                      import Resources
from pyTooling.Common               import getResourceFile
from pyTooling.Testing.ReportWriter import SCHEMA_FILES, SCHEMA_VERSION_LATEST

schemaPath: Path = getResourceFile(Resources, SCHEMA_FILES[SCHEMA_VERSION_LATEST])

Schema Content

from pathlib                        import Path
from pyTooling                      import Resources
from pyTooling.Common               import readResourceFile
from pyTooling.Testing.ReportWriter import SCHEMA_FILES, SCHEMA_VERSION_LATEST

schemaContent: str = readResourceFile(Resources, SCHEMA_FILES[SCHEMA_VERSION_LATEST])

TestReport

PackageOverrides

OTLP-Traces