Skip to content

Commit a60d158

Browse files
committed
docs(readme): ⚡ add pip as installation method
1 parent 43f7d9b commit a60d158

File tree

1 file changed

+52
-31
lines changed

1 file changed

+52
-31
lines changed

README.md

+52-31
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- [![codecov](https://codecov.io/gh/crs4/rocrate-validator/branch/main/graph/badge.svg?token=3ZQZQZQZQZ)](https://codecov.io/gh/crs4/rocrate-validator) -->
88

9-
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.
1010

1111
* Supports CLI-based validation as well as programmatic validation (so it can
1212
easily be used by Python code).
@@ -25,77 +25,98 @@ Issue) before starting to develop patches you would like to contribute. The
2525
implementation of validation code for additional RO-Crate profiles would be
2626
particularly welcome.
2727

28-
## Setup
2928

30-
Follow these steps to set up the project:
29+
## Installation
3130

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:
3336

3437
```bash
35-
git clone https://github.com/crs4/rocrate-validator.git
36-
cd rocrate-validator
37-
```
38+
python3 -m venv .venv
39+
````
3840

39-
2. **Set up a Python virtual environment (optional)**
41+
Then, activate the virtual environment:
4042

41-
Set up a Python virtual environment using `venv`:
43+
* On **Unix** or **macOS**:
4244

4345
```bash
44-
python3 -m venv .venv
4546
source .venv/bin/activate
4647
```
4748

48-
Or using `virtualenv`:
49+
* On **Windows** (Command Prompt):
4950

5051
```bash
51-
virtualenv .venv
52-
source .venv/bin/activate
52+
.venv\Scripts\activate
5353
```
5454

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):
5656

57-
3. **Install the project using Poetry**
57+
```powershell
58+
.venv\Scripts\Activate.ps1
59+
```
5860

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`:
6064

6165
```bash
62-
poetry install
66+
pip install roc-validator
6367
```
6468

65-
## Usage
69+
### 2. Using `poetry` (from source)
6670

67-
After installation, you can use the main command `rocrate-validator` to validate ROCrates.
71+
Clone the repository:
6872

69-
### Using Poetry
73+
```bash
74+
git clone https://github.com/kikkomep/rocrate-validator.git
75+
```
7076

71-
Run the validator using the following command:
77+
Navigate to the project directory:
7278

7379
```bash
74-
poetry run rocrate-validator validate <path_to_rocrate>
80+
cd rocrate-validator
7581
```
7682

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`:
7884

79-
Type `poetry run rocrate-validator --help` for more information.
85+
```bash
86+
poetry install
87+
```
8088

81-
### Using the installed package on your virtual environment
8289

83-
Activate the virtual environment:
90+
## Usage
8491

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

89-
Then, run the validator using the following command:
94+
### 1. Using the installed package
95+
96+
Run the validator using the following command:
9097

9198
```bash
9299
rocrate-validator validate <path_to_rocrate>
93100
```
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+
94105

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

97116
Type `rocrate-validator --help` for more information.
98117

118+
119+
99120
## Running the tests
100121

101122
To run the tests, use the following command:

0 commit comments

Comments
 (0)