Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time


Zenodo DOI Travis build status SonarCloud Quality Gate PyPi Badge CII Best Practices Research Software Directory

Read CFF formatted CITATION file from a GitHub url and convert it to various formats, such as:

  1. BibTeX
  2. EndNote
  3. codemeta
  4. plain JSON
  6. RIS
  7. Zenodo JSON

Supported types of GitHub URL:


cffconvert does not support the full CFF spec yet.

For users


There are a few options:

Option 1 (preferred): install in user space.

Ensure that the user space directory ~/.local/bin/ is on the PATH.

pip3 install --user cffconvert

Option 2: use ``cffconvert`` as a Google Cloud Function

cffconvert comes with an interface for running as a Google Cloud Function. We set it up here 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

On Google Cloud Function, set requirements.txt to:


and use the following as

from cffconvert.gcloud import cffconvert

def main(request):
   return cffconvert(request)

Option 3 (not preferred): install in virtual environment

virtualenv -p /usr/bin/python3.5 myvenv3
source myvenv3/bin/activate
pip3 install cffconvert

Option 4 (not preferred): install globally

Note: this option needs sudo rights.

sudo -H pip3 install cffconvert

Option 5 (not preferred): install with conda


conda install pip
pip install cffconvert

Option 6 (not preferred): install with in the user environment

python install --user

Command line interface

See cffconvert's options:

cffconvert --help


Usage: cffconvert [OPTIONS]

  -if, --infile TEXT          Path to the CITATION.cff input file. Use '--infile -' to read from STDIN.
  -of, --outfile TEXT         Path to the output file.
  -f, --outputformat TEXT     Output format: bibtex|cff|codemeta|endnote|ris||zenodo
  -u, --url TEXT              URL of the repo containing the CITATION.cff (currently only is supported; may
                              include branch name, commit sha, tag name). For example: '
                              file-format/cff-converter-python' or '
  --validate                  Validate the CITATION.cff found at the URL or supplied through '--infile'
  -ig, --ignore-suspect-keys  If True, ignore any keys from CITATION.cff that are likely out of date, such as
                              'commit', 'date-released', 'doi', and 'version'.
  --verbose                   Provide feedback on what was entered.
  --version                   Print version and exit.
  --help                      Show this message and exit.

Example usage, retrieve CITATION.cff from URL with curl, output as BibTeX:

curl > CITATION.cff
cffconvert -f bibtex

Results in:

author = {
            Jurriaan H. Spaaks and
            Tom Klaver
title  = {cff-converter-python},
month  = {1},
year   = {2018},
doi    = {10.5281/zenodo.1162057},
url    = {}

Example usage, let cffconvert retrieve CITATION.cff from URL, output as codemeta.json:

cffconvert -f codemeta \
-u \
-of codemeta.json

Contents of file codemeta.json:

   "@context": "",
   "@type": "SoftwareSourceCode",
   "author": [
         "@id": "",
         "@type": "Person",
         "affiliation": {
            "@type": "Organization",
            "legalName": "Netherlands eScience Center"
         "familyName": "Spaaks",
         "givenName": "Jurriaan H."
         "@type": "Person",
         "affiliation": {
            "@type": "Organization",
            "legalName": "Netherlands eScience Center"
         "familyName": "Klaver",
         "givenName": "Tom"
         "@id": "",
         "@type": "Person",
         "affiliation": {
            "@type": "Organization",
            "legalName": "Netherlands eScience Center"
         "familyName": "Verhoeven",
         "givenName": "Stefan"
         "@id": "",
         "@type": "Person",
         "affiliation": {
            "@type": "Organization",
            "legalName": "Humboldt-Universität zu Berlin"
         "familyName": "Druskat",
         "givenName": "Stephan"
   "codeRepository": "",
   "datePublished": "2019-11-12",
   "description": "Command line program to convert from Citation File Format to various other formats such as BibTeX, EndNote, RIS,, and .zenodo.json.",
   "identifier": "",
   "keywords": [
   "license": "",
   "name": "cffconvert",
   "version": "1.3.3"

Convert the contents of a local file CITATION.cff into the format used by .zenodo.json files (see Zenodo's API docs), while ignoring any keys that are likely out of date:

cffconvert -f zenodo --ignore-suspect-keys

Results in (note absence of date-released, doi, and version):

    "creators": [
            "affiliation": "Netherlands eScience Center",
            "name": "Spaaks, Jurriaan H."
            "affiliation": "Netherlands eScience Center",
            "name": "Klaver, Tom"
            "affiliation": "Netherlands eScience Center",
            "name": "Verhoeven, Stefan"
    "keywords": [
    "license": {
        "id": "Apache-2.0"
    "title": "cffconvert"

For developers


# get a copy of the cff-converter-python software
git clone
# change directory into cff-converter-python
cd cff-converter-python
# make a Python3.6 virtual environment named venv36
python3 -m virtualenv -p /usr/bin/python3.6 venv36
# activate the virtual environment
source ./venv36/bin/activate
# install any packages that cff-converter-python needs
pip install -r requirements.txt
# install any packages used for development such as for testing
pip install -r requirements-dev.txt

Running tests

# (from the project root)

# run unit tests
python3 -m pytest test/1.1.0
python3 -m pytest test/1.0.3
python3 -m pytest test/unsupported

# tests for consistent file naming
bash test/ dir=test/
bash test/ dir=livetest/

# tests for consistent versioning
python3 -m pytest test/

# run tests against live system (GitHub)
python3 -m pytest livetest

For maintainers

Making a release

# make sure the release notes are up to date

# run the live tests and unit tests, make sure they pass

# remove old cffconvert from your system if you have it
python3 -m pip uninstall cffconvert

# this next command should now return empty
which cffconvert

# install the package to user space, using no caching (can bring to light dependency problems)
python3 -m pip install --user --no-cache-dir --editable .
# check if cffconvert works, e.g.
cffconvert --version

# git push everything, merge into master as appropriate

# verify that everything has been pushed and merged by testing as follows
cd $(mktemp -d)
git clone
cd cff-converter-python
python3 -m virtualenv -p /usr/bin/python3.6 venv36
source venv36/bin/activate
pip install --no-cache-dir -r requirements.txt
pip install --no-cache-dir -r requirements-dev.txt

# run the tests according to section above

# register with PyPI test instance

# remove these directories if you have them
rm -rf dist
rm -rf
# make a source distribution:
python sdist
# install the 'upload to pypi/testpypi tool' aka twine
pip install twine
# upload the contents of the source distribtion we just made
twine upload --repository-url dist/*

# checking the package
python3.6 -m pip -v install --user --no-cache-dir \
--index-url \
--extra-index-url cffconvert

# check that the package works as it should when installed from pypitest

# FINAL STEP: upload to PyPI
twine upload dist/*


Command line utility to read CITATION.cff file from a GitHub url or local file and convert it to BibTex and other formats.





No packages published