Skip to main content

A Python package to validate RO-Crates

Project description

rocrate-validator

Testing Pipeline Status Release Pipeline Status PyPI - Version License

A Python package to validate RO-Crates.

  • 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.

Installation

You can install the package using pip or poetry. The following instructions assume you have Python 3.8 or later installed.

Optional Step: Create a Virtual Environment

It’s recommended to create a virtual environment before installing the package to avoid dependency conflicts. You can create one using the following command:

python3 -m venv .venv

Then, activate the virtual environment:

  • On Unix or macOS:
source .venv/bin/activate
  • On Windows (Command Prompt):
.venv\Scripts\activate
  • On Windows (PowerShell):
.venv\Scripts\Activate.ps1

1. Using pip (from PyPI)

You can install the package using pip:

pip install roc-validator

2. Using poetry (from source)

Clone the repository:

git clone https://github.com/kikkomep/rocrate-validator.git

Navigate to the project directory:

cd rocrate-validator

Ensure you have Poetry installed. If not, follow the instructions here. Then, install the package using poetry:

poetry install

Usage

After installation, use the rocrate-validator command to validate RO-Crates. You can run this in a virtual activated environment (if created in the optional step above) or without a virtual environment if none was created.

1. Using the installed package

Run the validator using the following command:

rocrate-validator validate <path_to_rocrate>

where <path_to_rocrate> is the path to the RO-Crate you want to validate.

Type rocrate-validator --help for more information.

2. Using poetry

Run the validator using the following command:

poetry run rocrate-validator validate <path_to_rocrate>

where <path_to_rocrate> is 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:

  • the BY-COVID project (HORIZON Europe grant agreement number 101046203);
  • the LIFEMap project, funded by the Italian Ministry of Health (Piano Operative Salute, Trajectory 3).

Co-funded by the EU

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

roc_validator-0.4.5.tar.gz (88.7 kB view details)

Uploaded Source

Built Distribution

roc_validator-0.4.5-py3-none-any.whl (177.6 kB view details)

Uploaded Python 3

File details

Details for the file roc_validator-0.4.5.tar.gz.

File metadata

  • Download URL: roc_validator-0.4.5.tar.gz
  • Upload date:
  • Size: 88.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for roc_validator-0.4.5.tar.gz
Algorithm Hash digest
SHA256 7ed0ebfe8ee5cb5a3c898e2d42e11c35070b6482a5bfd1c273bad246fb0849fe
MD5 4a67dd229e08de50cfce1dc7ac4fe262
BLAKE2b-256 76536efd55d633b5874c83fc7895697f1801dad80611aad7501a646ab134f644

See more details on using hashes here.

Provenance

The following attestation bundles were made for roc_validator-0.4.5.tar.gz:

Publisher: release.yaml on crs4/rocrate-validator

Attestations:

File details

Details for the file roc_validator-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for roc_validator-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f2bc45e919343083968c7c084942699b7b68b63811c3b8a92b23fc094aebaee6
MD5 c848c2bfcd7a55df8dbac97c65af5856
BLAKE2b-256 7525eb00e8457311cf40e21c955836d62b1c6c14dfc961d5d6f469bfe1448420

See more details on using hashes here.

Provenance

The following attestation bundles were made for roc_validator-0.4.5-py3-none-any.whl:

Publisher: release.yaml on crs4/rocrate-validator

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page