A Python package to validate RO-Crates
Project description
rocrate-validator
A Python package to validate RO-Crate packages.
- Supports CLI-based validation as well as programmatic validation (so it can easily be used by Python code).
- Implements an extensible validation framework to which new RO-Crate profiles can be added. Validation is based on SHACL shapes and Python code.
- Currently, validations for the following profiles are implemented: RO-Crate (base profile), Workflow RO-Crate, Process Run Crate. More are being implemented.
Note: this software is still work in progress. Feel free to try it out, report positive and negative feedback. Do send a note (e.g., by opening an Issue) before starting to develop patches you would like to contribute. The implementation of validation code for additional RO-Crate profiles would be particularly welcome.
Setup
Follow these steps to set up the project:
- Clone the repository
git clone https://github.com/crs4/rocrate-validator.git
cd rocrate-validator
- Set up a Python virtual environment (optional)
Set up a Python virtual environment using venv
:
python3 -m venv .venv
source .venv/bin/activate
Or using virtualenv
:
virtualenv .venv
source .venv/bin/activate
This step, while optional, is recommended for isolating your project dependencies. If skipped, Poetry will automatically create a virtual environment for you.
- Install the project using Poetry
Ensure you have Poetry installed. If not, follow the instructions here. Then, install the project:
poetry install
Usage
After installation, you can use the main command rocrate-validator
to validate ROCrates.
Using Poetry
Run the validator using the following command:
poetry run rocrate-validator validate <path_to_rocrate>
Replace <path_to_rocrate>
with the path to the RO-Crate you want to validate.
Type poetry run rocrate-validator --help
for more information.
Using the installed package on your virtual environment
Activate the virtual environment:
source .venv/bin/activate
Then, run the validator using the following command:
rocrate-validator validate <path_to_rocrate>
Replace <path_to_rocrate>
with the path to the RO-Crate you want to validate.
Type rocrate-validator --help
for more information.
Running the tests
To run the tests, use the following command:
poetry run pytest
License
This project is licensed under the terms of the Apache License 2.0. See the LICENSE file for details.
Acknowledgements
This work has been partially funded by the following sources:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for roc_validator-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a08d27d6ecf2836a3e4e1cde59904d38b77eec9936cfda72787347a7063e4c5 |
|
MD5 | 7f4a294db931bd64e1375216c3fb807f |
|
BLAKE2b-256 | 3b2d467d7c6c276fd1f926f97ea22795cf7b0308ba25badcb2e172d04a8a8717 |