# rocrate-validator
[![Testing Pipeline Status](https://img.shields.io/github/actions/workflow/status/crs4/rocrate-validator/testing.yaml?label=Tests&logo=pytest)](https://github.com/crs4/rocrate-validator/actions/workflows/testing.yaml) [![Release Pipeline Status](https://img.shields.io/github/actions/workflow/status/crs4/rocrate-validator/release.yaml?label=Build&logo=python&logoColor=yellow)](https://github.com/crs4/rocrate-validator/actions/workflows/release.yaml) [![PyPI - Version](https://img.shields.io/pypi/v/roc-validator?logo=pypi&logoColor=green&label=PyPI)](https://pypi.org/project/roc-validator/) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?logo=apache&logoColor=red)](https://opensource.org/licenses/Apache-2.0)
<!-- [![Build Status](https://repolab.crs4.it/lifemonitor/rocrate-validator/badges/develop/pipeline.svg)](https://repolab.crs4.it/lifemonitor/rocrate-validator/-/pipelines?page=1&scope=branches&ref=develop) -->
<!-- [![codecov](https://codecov.io/gh/crs4/rocrate-validator/branch/main/graph/badge.svg?token=3ZQZQZQZQZ)](https://codecov.io/gh/crs4/rocrate-validator) -->
A Python package to validate [RO-Crate](https://researchobject.github.io/ro-crate/)s.
* 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](https://www.researchobject.org/ro-crate/specification/1.1/workflows.html),
[Process Run
Crate](https://www.researchobject.org/workflow-run-crate/profiles/0.1/process_run_crate.html).
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](#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:
```bash
python3 -m venv .venv
````
Then, activate the virtual environment:
* On **Unix** or **macOS**:
```bash
source .venv/bin/activate
```
* On **Windows** (Command Prompt):
```bash
.venv\Scripts\activate
```
* On **Windows** (PowerShell):
```powershell
.venv\Scripts\Activate.ps1
```
### 1. Using `pip` (from PyPI)
You can install the package using `pip`:
```bash
pip install roc-validator
```
### 2. Using `poetry` (from source)
Clone the repository:
```bash
git clone https://github.com/kikkomep/rocrate-validator.git
```
Navigate to the project directory:
```bash
cd rocrate-validator
```
Ensure you have Poetry installed. If not, follow the instructions [here](https://python-poetry.org/docs/#installation). Then, install the package using `poetry`:
```bash
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](#optional-step-create-a-virtual-environment) above) or without a virtual environment if none was created.
### 1. Using the installed package
Run the validator using the following command:
```bash
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:
```bash
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:
```bash
poetry run pytest
```
<!-- ## Contributing
Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) for details. -->
## License
This project is licensed under the terms of the Apache License 2.0. See the
[LICENSE](LICENSE) file for details.
## Acknowledgements
This work has been partially funded by the following sources:
* the [BY-COVID](https://by-covid.org/) project (HORIZON Europe grant agreement number 101046203);
* the [LIFEMap](https://www.thelifemap.it/) project, funded by the Italian Ministry of Health (Piano Operative Salute, Trajectory 3).
<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"/>
Raw data
{
"_id": null,
"home_page": "https://github.com/crs4/rocrate-validator",
"name": "roc-validator",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.9.20",
"maintainer_email": null,
"keywords": "RO-Crate, validation, metadata, research object, data management, scientific data, Python",
"author": "Marco Enrico Piras",
"author_email": "kikkomep@crs4.it",
"download_url": "https://files.pythonhosted.org/packages/c6/de/329cbda8c8c83149eb7e9ec14caadbea4970b1d687a58c13331c5612569e/roc_validator-0.4.6.tar.gz",
"platform": null,
"description": "# rocrate-validator\n\n[![Testing Pipeline Status](https://img.shields.io/github/actions/workflow/status/crs4/rocrate-validator/testing.yaml?label=Tests&logo=pytest)](https://github.com/crs4/rocrate-validator/actions/workflows/testing.yaml) [![Release Pipeline Status](https://img.shields.io/github/actions/workflow/status/crs4/rocrate-validator/release.yaml?label=Build&logo=python&logoColor=yellow)](https://github.com/crs4/rocrate-validator/actions/workflows/release.yaml) [![PyPI - Version](https://img.shields.io/pypi/v/roc-validator?logo=pypi&logoColor=green&label=PyPI)](https://pypi.org/project/roc-validator/) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?logo=apache&logoColor=red)](https://opensource.org/licenses/Apache-2.0)\n\n<!-- [![Build Status](https://repolab.crs4.it/lifemonitor/rocrate-validator/badges/develop/pipeline.svg)](https://repolab.crs4.it/lifemonitor/rocrate-validator/-/pipelines?page=1&scope=branches&ref=develop) -->\n\n<!-- [![codecov](https://codecov.io/gh/crs4/rocrate-validator/branch/main/graph/badge.svg?token=3ZQZQZQZQZ)](https://codecov.io/gh/crs4/rocrate-validator) -->\n\nA Python package to validate [RO-Crate](https://researchobject.github.io/ro-crate/)s.\n\n* Supports CLI-based validation as well as programmatic validation (so it can\n easily be used by Python code).\n* Implements an extensible validation framework to which new RO-Crate profiles\n can be added. Validation is based on SHACL shapes and Python code.\n* Currently, validations for the following profiles are implemented: RO-Crate\n (base profile), [Workflow\n RO-Crate](https://www.researchobject.org/ro-crate/specification/1.1/workflows.html),\n [Process Run\n Crate](https://www.researchobject.org/workflow-run-crate/profiles/0.1/process_run_crate.html).\n More are being implemented.\n\n**Note**: this software is still work in progress. Feel free to try it out,\nreport positive and negative feedback. Do send a note (e.g., by opening an\nIssue) before starting to develop patches you would like to contribute. The\nimplementation of validation code for additional RO-Crate profiles would be\nparticularly welcome.\n\n\n## Installation\n\nYou can install the package using `pip` or `poetry`. The following instructions assume you have Python 3.8 or later installed.\n\n#### [Optional Step: Create a Virtual Environment](#optional-step-create-a-virtual-environment)\n\nIt\u2019s recommended to create a virtual environment before installing the package to avoid dependency conflicts. You can create one using the following command:\n\n```bash\npython3 -m venv .venv\n````\n\nThen, activate the virtual environment:\n\n* On **Unix** or **macOS**:\n\n```bash\nsource .venv/bin/activate\n```\n\n* On **Windows** (Command Prompt):\n\n```bash\n.venv\\Scripts\\activate\n```\n\n* On **Windows** (PowerShell):\n\n```powershell\n.venv\\Scripts\\Activate.ps1\n```\n\n### 1. Using `pip` (from PyPI)\n\nYou can install the package using `pip`:\n\n```bash\npip install roc-validator\n```\n\n### 2. Using `poetry` (from source)\n\nClone the repository:\n\n```bash\ngit clone https://github.com/kikkomep/rocrate-validator.git\n```\n\nNavigate to the project directory:\n\n```bash\ncd rocrate-validator\n```\n\nEnsure you have Poetry installed. If not, follow the instructions [here](https://python-poetry.org/docs/#installation). Then, install the package using `poetry`:\n\n```bash\npoetry install\n```\n\n\n## Usage\n\nAfter 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](#optional-step-create-a-virtual-environment) above) or without a virtual environment if none was created.\n\n### 1. Using the installed package\n\nRun the validator using the following command:\n\n```bash\nrocrate-validator validate <path_to_rocrate>\n```\nwhere `<path_to_rocrate>` is the path to the RO-Crate you want to validate.\n\nType `rocrate-validator --help` for more information.\n\n\n\n### 2. Using `poetry`\n\nRun the validator using the following command:\n\n```bash\npoetry run rocrate-validator validate <path_to_rocrate>\n```\nwhere `<path_to_rocrate>` is the path to the RO-Crate you want to validate.\n\nType `rocrate-validator --help` for more information.\n\n\n\n## Running the tests\n\nTo run the tests, use the following command:\n\n```bash\npoetry run pytest\n```\n\n<!-- ## Contributing\n\nContributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) for details. -->\n\n## License\n\nThis project is licensed under the terms of the Apache License 2.0. See the\n[LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\nThis work has been partially funded by the following sources:\n\n* the [BY-COVID](https://by-covid.org/) project (HORIZON Europe grant agreement number 101046203);\n* the [LIFEMap](https://www.thelifemap.it/) project, funded by the Italian Ministry of Health (Piano Operative Salute, Trajectory 3).\n\n<img alt=\"Co-funded by the EU\"\n src=\"https://raw.githubusercontent.com/crs4/rocrate-validator/develop/docs/img/eu-logo/EN_Co-fundedbytheEU_RGB_POS.png\"\n width=\"250\" align=\"right\"/>\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A Python package to validate RO-Crates",
"version": "0.4.6",
"project_urls": {
"Documentation": "https://github.com/crs4/rocrate-validator",
"Homepage": "https://github.com/crs4/rocrate-validator",
"Repository": "https://github.com/crs4/rocrate-validator"
},
"split_keywords": [
"ro-crate",
" validation",
" metadata",
" research object",
" data management",
" scientific data",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6bf568469df52caff95e6d294d206101275399c8175ce2aca7c89cef0288320a",
"md5": "7727ca578ef7cf81b042ff721143c159",
"sha256": "e1f870b07f892674a5f9c85457f84e0e155ab6abda62f5b71b4b997c52d50545"
},
"downloads": -1,
"filename": "roc_validator-0.4.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7727ca578ef7cf81b042ff721143c159",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.9.20",
"size": 177626,
"upload_time": "2024-11-13T12:35:06",
"upload_time_iso_8601": "2024-11-13T12:35:06.381827Z",
"url": "https://files.pythonhosted.org/packages/6b/f5/68469df52caff95e6d294d206101275399c8175ce2aca7c89cef0288320a/roc_validator-0.4.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6de329cbda8c8c83149eb7e9ec14caadbea4970b1d687a58c13331c5612569e",
"md5": "3c4b70dee1d2e60a86606828c9119c56",
"sha256": "6c1a5864508290b7081b68b6854a4095c644433a47351e870396fe26b2dbae7a"
},
"downloads": -1,
"filename": "roc_validator-0.4.6.tar.gz",
"has_sig": false,
"md5_digest": "3c4b70dee1d2e60a86606828c9119c56",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.9.20",
"size": 88657,
"upload_time": "2024-11-13T12:35:08",
"upload_time_iso_8601": "2024-11-13T12:35:08.423030Z",
"url": "https://files.pythonhosted.org/packages/c6/de/329cbda8c8c83149eb7e9ec14caadbea4970b1d687a58c13331c5612569e/roc_validator-0.4.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-13 12:35:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crs4",
"github_project": "rocrate-validator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "roc-validator"
}