roc-validator

raw JSON →
0.9.0 verified Mon Apr 27 auth: no python

A Python package to validate RO-Crates (Research Object Crate) against profiles and checks. Current version 0.9.0, requires Python >=3.10, <4.0. Active development with regular releases.

pip install roc-validator
error ModuleNotFoundError: No module named 'roc_validator'
cause Using underscores in the module name; the correct module is 'rocvalidator' (no underscore).
fix
Change import to 'from rocvalidator import ...'
error RuntimeError: This package requires Python 3.10 or later
cause Package version >=0.8.0 does not support Python 3.9.
fix
Upgrade Python to 3.10+ or use roc-validator <0.8.0.
error AttributeError: 'NoneType' object has no attribute 'status'
cause The result object may be None if validation fails silently; check the validator's output properly.
fix
Ensure the path exists and is a valid RO-Crate. Use validator.validate(path) which returns a ValidationResult or raises an exception.
breaking Python 3.9 support dropped in version 0.8.0; requires Python >=3.10.
fix Upgrade to Python 3.10 or later.
gotcha Import path uses 'rocvalidator' not 'roc_validator'. Incorrect import will raise ModuleNotFoundError.
fix Use 'from rocvalidator...' instead of 'from roc_validator...'.
deprecated The 'requests_cache.install_cache' call was removed in 0.6.4. If you rely on caching, update usage.
fix Use the built-in caching via ROCrateValidator's constructor or CLI options.
gotcha The package is installed as 'roc-validator' on PyPI, but the Python module is 'rocvalidator'.
fix Install with 'pip install roc-validator', then import 'rocvalidator'.

Basic usage: create a validator instance and call validate with the path to an RO-Crate directory.

from rocvalidator.validator import ROCrateValidator

# Validate an RO-Crate from a directory path
validator = ROCrateValidator()
result = validator.validate('/path/to/ro-crate')
print(result)

# Or use CLI
# roc-validator validate /path/to/ro-crate