pyshacl
Python SHACL Validator
Decision gist · record as of 2026-08-14
Yes. pySHACL is actively maintained, has low install friction, carries a permissive Apache 2.0 license, and is the standard Python implementation of the W3C SHACL specification. Install it if you work with RDF graphs and need constraint validation; it is production-stable and suitable for both command-line and programmatic use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires RDF data and SHACL shape files in a supported format (Turtle, XML, JSON-LD, N-Triples, or N3); rdflib and owlrl must be available.
- Low install friction with a pure Python wheel distribution.
- Active maintenance with a release 17 days ago and recent commits; supports Python 3.9 through 3.13.
License · maintenance · safety
permissive license (permissive) — Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions—only requiring license and copyright notice preservation.
last release 2026-07-28 (17 days) · last repo commit 2026-07-28 · 339 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,058,329 downloads/mo, #4,426 on PyPI
Alternatives
Verify before relying
from pyshacl import validate
data_graph = "data.ttl"
shacl_graph = "shapes.ttl"
conforms, results_graph, results_text = validate(
data_graph,
shacl_graph=shacl_graph,
inference='rdfs'
)- Performance characteristics when validating large RDF graphs or deeply nested shape hierarchies.
- Completeness of SHACL Advanced Features and SHACL-JS support relative to the W3C specification.
- Behavior and error handling when validating against malformed or incomplete SHACL shapes.
What it is and what it does
pySHACL is a pure Python validator that checks whether RDF graphs conform to constraints defined in SHACL (Shapes Constraint Language) shape graphs. It uses rdflib for RDF handling and integrates owlrl for optional OWL2 RL Profile inference on data before validation. The validator can run standalone via command-line or be imported as a Python module; it supports multiple output formats (human-readable, table, Turtle, XML, JSON-LD, N-Triples, N3) and offers advanced features like meta-SHACL validation, SHACL Rules iteration, and optional Oxigraph backend support.
Typical workflows involve loading a data graph and a shapes graph, optionally applying inference rules, and then validating the data against the constraints. The package returns a conformance boolean, a results graph in RDF, and human-readable validation text. It adheres to the W3C SHACL Recommendation and is designed for semantic web and linked data applications where schema validation and data quality checks are critical.
Use it for
- Validate RDF datasets against organizational data quality rules before ingestion into a knowledge graph.
- Enforce schema constraints on linked data published as part of a semantic web application.
- Perform automated compliance checks on RDF exports from databases or ontology repositories.
- Integrate SHACL validation into data pipelines to catch malformed triples early.
- Test SHACL shape definitions themselves using meta-SHACL before deploying them in production.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pySHACL is actively maintained, has low install friction, carries a permissive Apache 2.0 license, and is the standard Python implementation of the W3C SHACL specification. Install it if you work with RDF graphs and need constraint validation; it is production-stable and suitable for both command-line and programmatic use.
Install
pyshacl on PyPI
Before you install
Low install friction with a pure Python wheel distribution. Active maintenance with a release 17 days ago and recent commits; supports Python 3.9 through 3.13.
Requires RDF data and SHACL shape files in a supported format (Turtle, XML, JSON-LD, N-Triples, or N3); rdflib and owlrl must be available.
License in practice
Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions—only requiring license and copyright notice preservation.
Quickstart
from pyshacl import validate
data_graph = "data.ttl"
shacl_graph = "shapes.ttl"
conforms, results_graph, results_text = validate(
data_graph,
shacl_graph=shacl_graph,
inference='rdfs'
)
Verify before relying
- Performance characteristics when validating large RDF graphs or deeply nested shape hierarchies.
- Completeness of SHACL Advanced Features and SHACL-JS support relative to the W3C specification.
- Behavior and error handling when validating against malformed or incomplete SHACL shapes.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesimportlib-metadataowlrlpackagingprettytablerdflib |
| Maintenance | Actively maintained 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,058,329 / month, #4,426 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 :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities |
Evidence: pyshacl-0.40.1-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 › “RDF graph validation”
- pyshaclValidates RDF graphs against SHACL shape definitions, using rdflib…
- PyShExPyShEx parses and validates RDF data against Shape Expressions (ShEx)…
- ShExJSGShExJSG provides a Python object model for the ShEx 2.0 Shape…
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 owlrl · spdx3-validate · rdflib · PyShexC · pyoxigraph · spdx-python-model · PyShEx · CFGraph · owlready2 · rdflib-jsonld