Python 3.13
In the CLI (Git Bash / Terminal):
git clone <URL>
cd HDR-RO-Crate-Toolkits
Install the project in a virtual environment.
python3 -m venv <virtual_environment_name>
source <virtual_environment_name>/bin/activate
python -m pip install -e .
python3 -m venv <virtual_environment_name>
<virtual_environment_name>\Scripts\activate
python -m pip install -e .
This installs:
- the package itself
- the
rocrate-to-tesCLI - the development dependency
pytest
NOTE: For development work you may want to run
python -m pip install -e ".[dev]"
instead, which also installs the development dependency pytest.
Make a copy of env.template, rename it to .env and populate the variables.
Required variables:
CRATEY_VALIDATOR_API_URL: The URL for the ro-crate validation service. This ishttp://localhost:5001for the demonstration 5S-TES stack.
Copy the example-config.yml from the 5S-TES-Workbench repo and update the values. The path to this config file will be used when running the rocrate-to-tes command.
pytest -q
The rocrate-to-tes command accepts:
- a path to
ro-crate-metadata.json - a path to a directory containing
ro-crate-metadata.json - a path to a ZIP-packaged RO-Crate containing
ro-crate-metadata.json
rocrate-to-tes ro-crate-metadata.json --config_path 5s-tes-wb-config.yaml
Examples:
rocrate-to-tes /path/to/ro-crate-metadata.json --config_path /path/to/5s-tes-wb-config.yaml
rocrate-to-tes /path/to/ro-crate-directory --config_path /path/to/5s-tes-wb-config.yaml
rocrate-to-tes /path/to/ro-crate.zip --config_path /path/to/5s-tes-wb-config.yaml
If the tool runs successfully it should print the following information to the terminal:
- 'Validation passed' status, either True or False
- The TES message, as formatted JSON
- The 5S-TES response message, as formatted JSON, which contains the project and task ID's.