You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Python package to validate [RO-Crate](https://researchobject.github.io/ro-crate/) packages.
9
+
A Python package to validate [RO-Crate](https://researchobject.github.io/ro-crate/)s.
10
10
11
11
* Supports CLI-based validation as well as programmatic validation (so it can
12
12
easily be used by Python code).
@@ -25,77 +25,98 @@ Issue) before starting to develop patches you would like to contribute. The
25
25
implementation of validation code for additional RO-Crate profiles would be
26
26
particularly welcome.
27
27
28
-
## Setup
29
28
30
-
Follow these steps to set up the project:
29
+
## Installation
31
30
32
-
1.**Clone the repository**
31
+
You can install the package using `pip` or `poetry`. The following instructions assume you have Python 3.8 or later installed.
32
+
33
+
#### [Optional Step: Create a Virtual Environment](#optional-step-create-a-virtual-environment)
34
+
35
+
It’s recommended to create a virtual environment before installing the package to avoid dependency conflicts. You can create one using the following command:
2.**Set up a Python virtual environment (optional)**
41
+
Then, activate the virtual environment:
40
42
41
-
Set up a Python virtual environment using `venv`:
43
+
* On **Unix** or **macOS**:
42
44
43
45
```bash
44
-
python3 -m venv .venv
45
46
source .venv/bin/activate
46
47
```
47
48
48
-
Or using `virtualenv`:
49
+
* On **Windows** (Command Prompt):
49
50
50
51
```bash
51
-
virtualenv .venv
52
-
source .venv/bin/activate
52
+
.venv\Scripts\activate
53
53
```
54
54
55
-
This step, while optional, is recommended for isolating your project dependencies. If skipped, Poetry will automatically create a virtual environment for you.
55
+
* On **Windows** (PowerShell):
56
56
57
-
3.**Install the project using Poetry**
57
+
```powershell
58
+
.venv\Scripts\Activate.ps1
59
+
```
58
60
59
-
Ensure you have Poetry installed. If not, follow the instructions [here](https://python-poetry.org/docs/#installation). Then, install the project:
61
+
### 1. Using `pip` (from PyPI)
62
+
63
+
You can install the package using `pip`:
60
64
61
65
```bash
62
-
poetry install
66
+
pip install roc-validator
63
67
```
64
68
65
-
##Usage
69
+
### 2. Using `poetry` (from source)
66
70
67
-
After installation, you can use the main command `rocrate-validator` to validate ROCrates.
poetry run rocrate-validator validate <path_to_rocrate>
80
+
cdrocrate-validator
75
81
```
76
82
77
-
Replace `<path_to_rocrate>` with the path to the RO-Crate you want to validate.
83
+
Ensure you have Poetry installed. If not, follow the instructions [here](https://python-poetry.org/docs/#installation). Then, install the package using `poetry`:
78
84
79
-
Type `poetry run rocrate-validator --help` for more information.
85
+
```bash
86
+
poetry install
87
+
```
80
88
81
-
### Using the installed package on your virtual environment
82
89
83
-
Activate the virtual environment:
90
+
## Usage
84
91
85
-
```bash
86
-
source .venv/bin/activate
87
-
```
92
+
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.
88
93
89
-
Then, run the validator using the following command:
94
+
### 1. Using the installed package
95
+
96
+
Run the validator using the following command:
90
97
91
98
```bash
92
99
rocrate-validator validate <path_to_rocrate>
93
100
```
101
+
where `<path_to_rocrate>` is the path to the RO-Crate you want to validate.
102
+
103
+
Type `rocrate-validator --help`for more information.
104
+
94
105
95
-
Replace `<path_to_rocrate>` with the path to the RO-Crate you want to validate.
106
+
107
+
### 2. Using `poetry`
108
+
109
+
Run the validator using the following command:
110
+
111
+
```bash
112
+
poetry run rocrate-validator validate <path_to_rocrate>
113
+
```
114
+
where `<path_to_rocrate>` is the path to the RO-Crate you want to validate.
96
115
97
116
Type `rocrate-validator --help`for more information.
0 commit comments