spdx3-validate
Validates SPDX 3 data files
What it is and what it does
spdx3-validate is a Python library that validates SPDX 3 documents with awareness of external references and merged document graphs. While tools like pyshacl and check-jsonschema can validate SPDX 3 files against their schema, this package adds context-specific logic: it ignores SHACL errors for missing spdxIds when they are defined in an ExternalMap, validates that ExternalMap spdxIds are not duplicated in the document itself, and can validate merged document graphs to ensure referenced external spdxIds have compatible types when both documents are provided together.
The package can be used as a command-line tool or imported as a library. The validate() function accepts a single document path or URL, or an iterable of sources, and returns a ValidationResult object containing structured errors. SPDX version is auto-detected from each document's @context, though you can override it. It depends on pyshacl, rdflib, jsonschema, and halo for progress indication.
Use it for:
- Validate SPDX 3 software bill-of-materials documents before submission to compliance systems.
- Check that external component references in an SPDX document are correctly declared and not duplicated.
- Validate merged SPDX graphs when combining multiple documents with external references.
- Programmatically inspect validation errors in a Python application for custom error handling.
- Detect missing or incompatible @context declarations in SPDX 3 JSON files.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates SPDX 3 documents with context-aware checks for external references, merged graphs, and improved error reporting beyond standard SHACL and JSON schema validation.
Yes, if you need to validate SPDX 3 documents with external reference awareness. The package is actively maintained, has low install friction, carries a permissive MIT license, and adds real value over generic SHACL validation for SPDX-specific use cases. Beta status and early release history suggest caution in production deployments, but the recent activity and zero known vulnerabilities are positive signals.
Install
spdx3-validate on PyPI
pip
pip install spdx3-validateuv
uv add spdx3-validatepoetry
poetry add spdx3-validateInstalling spdx3-validate
Before you install
Low friction: pure Python wheel with four runtime dependencies (halo, jsonschema, pyshacl, rdflib). Active maintenance with a release within days of the fact sheet date. Supports Python 3.8 through 3.14.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install spdx3-validate
import spdx3_validate
result = spdx3_validate.validate("doc.spdx3.json")
if not result:
print(result) # prints errors, one per line
Requires Python 3.8 or later; SPDX documents must include a valid @context field for version detection.
Verify before relying
- Whether pyshacl, rdflib, and jsonschema are lightweight or bring significant transitive dependencies.
- Performance characteristics when validating large or complex SPDX documents.
- Whether the library is suitable for production use or primarily experimental (beta status).
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — halo, jsonschema, pyshacl, rdflib |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,144/month — #11,526 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spdx3_validate-0.0.7-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
pyshaclValidates RDF graphs against SHACL shape…
permissive · top 5,000 on PyPI
spdx-python-modelProvides Python bindings for the SPDX 3 data…
permissive · top 15,000 on PyPI
spdx-toolsParse, validate, create, and convert SPDX…
permissive · top 5,000 on PyPI
pyspdxValidates and tokenizes SPDX license…
copyleft · top 15,000 on PyPI
jsonschemajsonschema validates Python data structures…
permissive · top 100 on PyPI
check-jsonschemaA command-line tool and pre-commit hook that…
permissive · top 5,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
validate-docbrValidates and generates Brazilian identity and…
permissive · top 15,000 on PyPI
reusereuse is a command-line tool that validates and…
copyleft · top 15,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI