Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.7 KB

alternative-install-options.md

File metadata and controls

91 lines (64 loc) · 1.7 KB

Alternative install options for using cffconvert

Install in virtual environment

# use venv to make a virtual environment named env
python3 -m venv env

# activate the environment
source env/bin/activate

# install cffconvert in it
pip install cffconvert

Install globally

Note: this option needs sudo rights.

sudo -H python3 -m pip install cffconvert

Install with conda

Make an environment definition file environment.yml with the following contents:

name: env
channels:
  - conda-forge
  - defaults
dependencies:
  - pip
  - pip:
    - cffconvert

Then run:

conda env create --file environment.yml
conda activate env

No-install options

Using cffconvert as a Google Cloud Function

cffconvert comes with an interface for running as a Google Cloud Function. We set it up here https://bit.ly/cffconvert for the time being / as long as we have enough credits on the Google Cloud Function platform.

Really, all the Google Cloud interface does is get any supplied URL parameters, and use them as if they had been entered as command line arguments. For more detailed explanation and examples, see https://bit.ly/cffconvert.

On Google Cloud Function, set requirements.txt to:

cffconvert[gcloud]

and use the following as main.py:

from cffconvert.gcloud.gcloud import cffconvert

def main(request):
   return cffconvert(request)

Docker

Build the Docker container

cd <project root>
docker build --tag cffconvert:2.0.0 .
docker build --tag cffconvert:latest .

Build the Docker container

cd <where your CITATION.cff is>
docker run --rm -ti -v ${PWD}:/app cffconvert