eScienceLab / rocrate-validator

A Python package to validate RO-Crates
Apache License 2.0
0 stars 1 forks source link

rocrate-validator

Testing Pipeline Status Release Pipeline Status PyPI - Version License

A Python package to validate RO-Crates.

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:

source .venv/bin/activate
.venv\Scripts\activate
.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:

<img alt="Co-funded by the EU" src="https://raw.githubusercontent.com/crs4/rocrate-validator/develop/docs/img/eu-logo/EN_Co-fundedbytheEU_RGB_POS.png" width="250" align="right"/>