Skip to main content

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/CD or GitHub Actions 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 GitHub, or on a GitLab instance with Docker runners available.

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 automated workflows

You can integrate automated FACILE-RS workflows in your GitLab or GitHub repository using our templates. Each template provides a sample configuration for generating metadata and creating software releases with FACILE-RS.

GitLab CI/CD template

GitHub Actions template

Documentation

Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facile_rs-3.1.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FACILE_RS-3.1.0-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file facile_rs-3.1.0.tar.gz.

File metadata

  • Download URL: facile_rs-3.1.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for facile_rs-3.1.0.tar.gz
Algorithm Hash digest
SHA256 0c321dc9260a3cb6a81b2588f71e182d8d74bad7c4734a2fbed96c6c6486fb54
MD5 91d8e1d1bc19acff47e5291128f6e572
BLAKE2b-256 0107d808b972c129e55ee13c7134edcb8560a67e2d24ffdb4dfa02d46671ca69

See more details on using hashes here.

File details

Details for the file FACILE_RS-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: FACILE_RS-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 71.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for FACILE_RS-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e902afee4e0fb896f82b955c87b3f49d87c9049f99c7161e781c83fd7a1cdf08
MD5 2e16057a03768d24360eff841af67fc8
BLAKE2b-256 76b597eab640d548e2f3a65cb42ff5e8532d6639923df609e3355b1288dd0ef0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page