Alternative install options for using cffconvert
December 7, 2023 ยท View on GitHub
Install in virtual environment
# use venv to make a virtual environment named venv
python3 -m venv venv
# activate the environment
source venv/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: venv
channels:
- conda-forge
- defaults
dependencies:
- pip
- pip:
- cffconvert
Then run:
conda venv create --file environment.yml
conda activate venv
No-install options
Using cffconvert as a Google Cloud Function
cffconvert comes with an interface for
running as a Google Cloud Function.
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.
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:3.0.0a0 .
docker build --tag cffconvert:latest .
Run the Docker container
cd <where your CITATION.cff is>
docker run --rm -ti -v ${PWD}:/app cffconvert
Platform-specific packages
Alpine Linux
To install cffconvert on Alpine Linux, use:
apk add cffconvert
Fedora Linux
To install cffconvert on Fedora Linux, use:
dnf install cffconvert