FACILE-RS (Findability and Accessibility through Continuous Integration with Less Effort) automates tasks around the archival and long term preservation of software repositories.
Project description
FACILE-RS
This package (previously known as openCARP-CI) contains a set of Python scripts which can be used to perform tasks around the archival and long term preservation of software repositories. In particular, it can be used to:
- create a release in GitLab using the GitLab API,
- create a DataCite record based on CodeMeta files present in repositories,
- create a CFF (Citation File Format) file from CodeMeta files,
- create archive packages in the BagIt or BagPack formats.
- archive the software using the RADAR service,
- archive the software on Zenodo,
- use content from markdown files, bibtex files, or python docstrings to create web pages in a Grav CMS.
The scripts were created for the openCARP simulation software, but can be adopted for arbitrary projects. While they can be used on the command line, the scripts are mainly used within the GitLab CI to run automatically on each push to a repository, or when a tag is created.
An example of integration in a CI environment is provided in the tutorials. An example of a more complex setup are the openCARP CI file and the included subscripts.
Setup
Prerequisites
In order to generate metadata or publish software releases using FACILE-RS, it is necessary to create a CodeMeta metadata file for the software (for example using the CodeMeta generator).
In addition, if you want to use our preconfigured automated pipelines, your software repository needs to be hosted on a GitLab instance with Docker runners available.
It is technically possible to automate the FACILE-RS workflows on other platforms (for example using GitHub actions), but such examples have not been implemented yet.
Installation
FACILE-RS can be installed using pip:
pip install FACILE-RS
In order to use FACILE-RS from the command-line, we recommend to install the package in a virtual environment:
python -m venv env
source env/bin/activate
pip install FACILE-RS
Use FACILE-RS within GitLab CI/CD
In order to integrate automated FACILE-RS workflows into your GitLab project, you can use the FACILE-RS template (source, documentation), which provides a sample GitLab CI/CD configuration for generating metadata and creating software releases with FACILE-RS.
Documentation
FACILE-RS documentation is available at https://facile-rs.readthedocs.io/.
It can also be generated using Sphinx from docs/sphinxdocs by running:
pip install -r requirements.txt
make html
The Python packages in docs/sphinxdocs/requirements.txt as well as FACILE-RS itself must be installed in order to generate the documentation.
Usage
The FACILE-RS tools are available via the command facile-rs
.
More details about its usage are available in the documentation or by running facile-rs --help
.
facile-rs
expects a number of command line arguments. Default values can be set using environment variables (using upper case and underscores), i.e. the following lines do the same:
facile-rs bag create --bag-path=/path/to/bag
BAG_PATH=/path/to/bag facile-rs bag create
Environments variables can be set in the usual way, e.g. the .gitlab-ci.yml
file, but also in a .env
file in the directory where the script is invoked.
FACILE-RS comprises the following tools:
facile-rs cff create
Creates a Citation File Format (CFF) file from a CodeMeta file. An example output can be found here.
Deprecated alias: create_cff
facile-rs datacite create
Creates a DataCite XML file following the DataCite Metadata Schema 4.3. The information needed for this can be taken from (a list) of locations given as URL or local file path. CODEMETA_LOCATION
must point to a codemeta.json file. CREATORS_LOCATIONS
and CONTRIBUTORS_LOCATIONS
point to similar files which contain a list of creators
or contributors
, respectively.
For an example, see here.
Deprecated alias: create_datacite
facile-rs bag create
Creates a bag BagIt using the bagit-python package. The assets to be included in the bag are given as positional arguments.
Deprecated alias: create_bag
facile-rs bagpack create
Creates a bag BagIt similar to create_bag.py
, but also includes a DataCite XML file as recommended by the RDA Research Data Repository Interoperability WG.
Deprecated alias: create_bagpack
facile-rs release prepare
Updates the CodeMeta file for the given VERSION
and DATE
(as dateModified
, current date if omitted). Useful to automatically get the version from a git tag and inject it into the repo's metadata file.
Deprecated alias: prepare_release
facile-rs gitlab publish
Creates a release in GitLab using the GitLab API. A tag for the release needs to be created before and provided to the script. An example output can be found here.
Deprecated alias: create_release
facile-rs radar prepare
Creates an empty archive in the RADAR service in order to "reserve" a DOI and an ID in RADAR. Both are stored in the CodeMeta file and can be used by the create_radar
command below to include the DOI for this release in the deposited CodeMeta file. A detailed HowTo for releasing datasets on RADAR is provided in the file HOWTO_release_radar.md
in this directory.
Deprecated alias: prepare_radar
facile-rs radar upload
Creates an archive in the RADAR service and uploads the assets provided as positional arguments. The metadata is created similar to create_datacite
. If the RADAR ID is already in the CodeMeta file, the existing archive is updated instead. A detailed HowTo for releasing datasets on RADAR is provided in the file HOWTO_release_radar.md
in this directory.
Deprecated alias: create_radar
facile-rs zenodo prepare
Creates an empty archive on Zenodo in order to "reserve" a DOI and an ID in Zenodo. Both are stored in the CodeMeta file and can be used by the create_zenodo
command below to include the DOI for this release in the deposited CodeMeta file. A detailed HowTo for releasing datasets on Zenodo is provided in the tutorial 04_release_zenodo.md
.
Deprecated alias: prepare_zenodo
facile-rs zenodo upload
Creates an archive on Zenodo and uploads the assets provided as positional arguments. The metadata is created similar to create_datacite
. If the Zenodo ID is already in the CodeMeta file, the existing archive is updated instead. A detailed HowTo for releasing datasets on Zenodo is provided in the tutorial 04_release_zenodo.md
.
Deprecated alias: create_zenodo
facile-rs grav bibtex
Compiles and copies the content of bibtex files in a similar way to run_markdown_pipeline
. A CSL can be provided.
Please refer to https://git.opencarp.org/openCARP/publications for an example setup.
Deprecated alias: run_bibtex_pipeline
facile-rs grav docstring
Extracts and copies the content of reStructuredText docstrings of Python scripts. Contrary to the other pipelines, this script does not copy one file to one page in GRAV, but creates a tree of pages below one page (given by the pipeline
header). it processes all run.py
and __init__.py
files.
The PIPELINE
and PIPELINE_SOURCE
options are used in the same way as in rum_markdown_pipeline
. In addition, PIPELINE_IMAGES
specifies a directory where the images from the docstrings are located and PIPELINE_HEADER
and PIPELINE_FOOTER
options point to templates which are prepended and appended to each page. With the PIPELINE_REFS
YML file, you can specifie replacements for the references in the rst code.
Please refer to https://git.opencarp.org/openCARP/experiments for an example setup.
Deprecated alias: run_docstring_pipeline
facile-rs grav markdown
Copies the content of markdown files in the PIPELINE_SOURCE
to a Grav CMS repository given by GRAV_PATH
. The Grav repository is created by the Git-Sync Plugin.
The pages need to be already existing in Grav and contain a pipeline
and a source
field in their frontmatter. The script will find all pages which match the provided PIPELINE
and will overwrite content part of the page with the markdown file given by source
. If source is codemeta.json
, the content will be added to the frontmatter entry codemeta
rather than overwriting the page content. Twig templates digesting the metadata can be found in the file Twig_templates.md
in this directory.
After running the script, the changes to the Grav CMS repository can be committed and pushed and the Git-Sync Plugin will update the public pages.
See openCARP citation info or code of conduct for examples.
Deprecated alias: run_markdown_pipeline
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file facile_rs-3.0.0.tar.gz
.
File metadata
- Download URL: facile_rs-3.0.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12130f3df0126c5db90bdf8c41f9c32a319054252ad06f3140453d42a0bda63 |
|
MD5 | 08c6954f2b7fe84ef29f2ad946df35ce |
|
BLAKE2b-256 | 7c82c55537d1038e07d153e15f0c43c0cf21d281f6f665c4748953fac028a56e |
File details
Details for the file FACILE_RS-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: FACILE_RS-3.0.0-py3-none-any.whl
- Upload date:
- Size: 71.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48fab9181b68fe132a50456d90f34b0f47a86804f8d0582e6efb6f7684672b0c |
|
MD5 | df8f034429ab639f68439c9cc955992e |
|
BLAKE2b-256 | 6f8e0373d43049f4b318c4840f1acf4211d37bbd4f4cce12a05b628fa6568089 |