Registry / serialization / pyshexc

pyshexc

JSON →
library0.10.3.post1pypypi✓ verified 82d ago

PyShExC compiles Shape Expressions (ShEx) schemas into Python executable shapes. Version 0.9.1 supports ShEx 2.1 grammar, requires Python >=3.7, and is released irregularly.

pip install pyshexc
INSTALL
IMPORT
SIG · PYSHEXC
P
pyshexc
serializationpythonv0.10.3.post1
Install
4.0s avg
Import
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.3.post1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 31.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.000s · 33MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rdflib_shim
from pyshexc import rdflib_shim
from pyshexc.parser import compile_shex
shimin
from pyshexc import shimin
from pyshexc.parser import compile_shex

Compile a ShEx schema string into a Python object using compile_shex.

from pyshexc.parser import compile_shex shex_schema = """ PREFIX ex: <http://example.org/> ex:User IRI { ex:name xsd:string ; ex:email xsd:string } """ try: compiled = compile_shex(shex_schema) print("Schema compiled successfully") print(type(compiled)) except Exception as e: print(f"Compilation error: {e}")
shex --version
Debug
Known issues
gotchacompile_shex expects a ShEx schema string, not a file path. To read from file, open and read the file yourself.
fix
with open('schema.shex') as f: compile_shex(f.read())
affects: all
deprecatedThe top-level function 'compile' (from pyshexc) is deprecated; use 'compile_shex' from pyshexc.parser instead.
fix
from pyshexc.parser import compile_shex
affects: >=0.9.0
Upgrade
Version history
0.10.3.post1latest on PyPI · released May 1, 2026
Audit
Dependencies
antlr4-python3-runtimerequiredruntime dep for ANTLR grammar parsing
Agent activity
11 hits · last 30 days
node
10
Resources
pyshexc — pip install pyshexc · libregistry