shacl-rust (Python)
Python bindings for shacl-rust, a SHACL validator for RDF graphs written in Rust. Passes all 120 applicable tests of the W3C SHACL test suite.
pip install shacl-rust
import shacl_rust
shapes = """
@prefix ex: <http://example.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:PersonShape a sh:NodeShape ;
sh:targetClass ex:Person ;
sh:property [ sh:path ex:age ; sh:minInclusive 0 ; ] .
"""
data = """
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:alice a ex:Person ; ex:age "-3"^^xsd:integer .
"""
report = shacl_rust.validate(data, shapes)
print(report["conforms"]) # False
print(report["results"][0]) # violation details
# Fast path for large graphs (experimental interned index):
shacl_rust.conforms(data, shapes, experimental_index=True)
Large graphs can be streamed from disk or any binary file-like object, so the serialized text is never fully held in memory:
report = shacl_rust.validate_file("data.ttl", "shapes.ttl")
import gzip
with gzip.open("data.ttl.gz", "rb") as f:
ok = shacl_rust.conforms_file(f, "shapes.ttl", data_format="turtle",
experimental_index=True)
Formats: turtle/ttl (default), nt, nq, rdf, jsonld, trig via the
data_format= / shapes_format= keyword arguments (inferred from path
extensions for validate_file/conforms_file).
Diagnostics
Pass diagnostics=True to validate/validate_file to get rustc-style
diagnostics (shape lints, then violation diagnostics) alongside the report:
report = shacl_rust.validate(data, shapes, diagnostics=True)
print(report["conforms"]) # False
print(report["diagnostics"][0]["code"]) # e.g. "V0007"
print(report["diagnostics"][0]["severity"]) # "error", "warning", or "info"
print(report["diagnostics"][0]["title"]) # e.g. "value violates sh:minInclusive"
Each entry in report["diagnostics"] is a dict with code, severity,
title, constraint_component, snippets, expected, actual, notes,
help, focus_node, source_shape, path, and verdict. When
diagnostics is False or omitted (the default), the "diagnostics" key
is absent from the result dict entirely.
Metadata
Release files for shacl-rust 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shacl_rust-0.2.10.tar.gz | 165.0 kB | With provenance | Details for shacl_rust-0.2.10.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| shacl_rust-0.2.10-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for shacl_rust-0.2.10-cp39-abi3-win_amd64.whl |
| shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| shacl_rust-0.2.10-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.9 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 | Details for shacl_rust-0.2.10-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
Total release size: 12.0 MB
Release files / shacl_rust-0.2.10.tar.gz
| Download URL | shacl_rust-0.2.10.tar.gz |
|---|---|
| Size | 165.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7bb700f06d77857f354cec76a2a2db0465e80b841b2c328901d87499918ed55
|
|
BLAKE2b-256 checksum How to use checksums |
5ee5e0a5318a69f0e8472f28a54dde2a003c0f7996f946cbefeb19cbfd16bd5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / shacl_rust-0.2.10-cp39-abi3-win_amd64.whl
| Download URL | shacl_rust-0.2.10-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fe51f070d87342f0a9fe82e367319d8a85ead4e6ed44183aa1d83271111bf257
|
|
BLAKE2b-256 checksum How to use checksums |
66576919c75e144d124a54ed973d2394f3251940c2f8d5d3759dedf3b486d9d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
54a0f5befddbb9c7c6bbb16ad59fb9b3348664fa30cb2cd6eef06c2c7b711c68
|
|
BLAKE2b-256 checksum How to use checksums |
cc0f16679f3d4f0cc9e0f83030ee8db02844ed3aa2f226eb899837acbead6fcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | shacl_rust-0.2.10-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
fbb1b48e8436c410a70b73f4aa64b1d8965deccea2f3779d631092506776e434
|
|
BLAKE2b-256 checksum How to use checksums |
2baa8e7fc4029daafcf994ee1c98f45125bee81faf41bf4cfe2a1aeaf20156bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / shacl_rust-0.2.10-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | shacl_rust-0.2.10-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1f0a5394231e2a1c85deea774d6ebe03a51c664ec2c6fc30a877ddd4ce13a90b
|
|
BLAKE2b-256 checksum How to use checksums |
a1f29bef1e49ba72f3b83e29dfd4f2750bb4f3db1a8f70889b777ceb9732c199
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logSecurity for shacl-rust 0.2.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for shacl_rust-0.2.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.