Welcome to the RO-Crate Plugin! This repository contains tools to help you manage RO-Crates efficiently. It’s designed to be extensible and will integrate with Stencila in a future release.
Follow these steps to set up the RO-Crate Plugin on your local machine, whether you're using Windows, Linux, or macOS.
Before starting, ensure you have the following installed:
- Clone the repository
Open a terminal and run:
git clone https://github.com/LivePublication/ro-crate-plugin
- Navigate to the project directory
cd ro-crate-plugin - Ensure that the repository is up-to-date including the submodule(s):
git pull git submodule init git submodule update
- Install dependencies
pdm install
- Activate the virtual environment
source .venv/bin/activate - Run the RO-Crate Plugin
For now, run the plugin manually:
- Navigate to the file
rocrate_manager.pyand run main(). Note: Integration with the Stencila VS Code extension is under development and will replace step 7.
- Navigate to the file
We’ve included comprehensive tests to ensure the plugin functions correctly. Here’s how you can run and add tests:
- Navigate to the
testsdirectory:cd tests - Execute the tests using
pytest:A detailed test trace will display the results.pytest
To add new tests, navigate to the /tests directory. You can organize your tests under the following subdirectories:
/tests/crates: Tests for valid and invalid RO-Crate examples./tests/plugin: Tests related to the Stencila Plugin component./tests/unit: Unit tests for the core logic of the RO-Crate Plugin.
This repository is based on the Stencila Plugin Template. Learn more about it here.
The plugin depends on the following tools and libraries:
/src: contains the core logic for the RO-Crate Plugin.pyproject.toml: defines the package metadata (e.g., name, description, and author).tests/conftest.py: specifies the location of the plugin script.
The RO-Crate Plugin leverages the excellent work of the following open-source projects:
- crs4/rocrate-validator Used to validate all RO-Crate objects in this plugin. (Currently integrated as a Git submodule but will switch to a pip installation in the future.)
- ResearchObject/ro-crate-py A library for creating and consuming RO-Crate objects.
If you’d like to contribute, please:
- Fork the repository.
- Create a new branch for your feature or fix.
- Submit a pull request with detailed descriptions of your changes.
We are actively working on integrating this plugin with Stencila’s VS Code extension. Stay tuned for updates!