Command line program to validate and convert CITATION.cff files.
Project Links
Meta
Author: Jurriaan H. Spaaks
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
- Education
- Information Technology
- Science/Research
- System Administrators
License
- OSI Approved :: Apache Software License
Natural Language
- English
Programming Language
- Python :: 3
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
Topic
- Scientific/Engineering
- Software Development
- Utilities
cffconvert
Command line program to validate and convert CITATION.cff files.
Supported input versions of the Citation File Format:
| Citation File Format schema version | Link to Zenodo release |
|---|---|
1.2.0 |
|
1.1.0 |
|
1.0.3 |
|
1.0.2 |
|
1.0.1 |
Supported output formats:
- APA-like plaintext
- BibTeX
- CodeMeta
- EndNote
- RIS
- schema.org JSON
- Zenodo JSON
cffconvert does not support converting items from references or preferred-citation keys at the moment.
Installing
To install in user space,
python3 -m pip install --user cffconvert
Ensure that the user space directory ~/.local/bin/ is on the PATH.
which cffconvert
should now return the location of the program.
See docs/alternative-install-options.md for alternative install options.
Command line interface
See cffconvert's options:
cffconvert --help
Shows:
Usage: cffconvert [OPTIONS]
Options:
-i, --infile PATH Path to the CITATION.cff input file. If this
option is omitted, './CITATION.cff' is used.
-o, --outfile PATH Path to the output file.
-f, --format [apalike|bibtex|cff|codemeta|endnote|ris|schema.org|zenodo]
Output format.
-u, --url TEXT URL to the CITATION.cff input file.
-h, --help Show help and exit.
--show-trace Show error trace.
--validate Validate the CITATION.cff file and exit.
--version Print version and exit.
Example usage
Validating a local CITATION.cff file
cffconvert --validate
cffconvert --validate -i CITATION.cff
cffconvert --validate -i ${PWD}/CITATION.cff
cffconvert --validate -i ../some-other-dir/CITATION.cff
Validating a remote CITATION.cff file
cffconvert --validate --url https://github.com/<org>/<repo>
cffconvert --validate --url https://github.com/<org>/<repo>/commit/<sha>
cffconvert --validate --url https://github.com/<org>/<repo>/tree/<sha>
cffconvert --validate --url https://github.com/<org>/<repo>/tree/<tag>
cffconvert --validate --url https://github.com/<org>/<repo>/tree/<branch>
Converting metadata to other formats
If there is a valid CITATION.cff file in the current directory, you can convert to various other formats and
print the result on standard out with:
cffconvert -f bibtex
cffconvert -f codemeta
cffconvert -f endnote
cffconvert -f ris
cffconvert -f schema.org
cffconvert -f zenodo
cffconvert -f apalike
Writing to a file
# with i/o redirection:
cffconvert -f bibtex > bibtex.bib
cffconvert -f zenodo > zenodo.json
cffconvert -f endnote > ${PWD}/endnote.enw
# etc
# without i/o redirection
cffconvert -f bibtex -o bibtex.bib
cffconvert -f zenodo -o zenodo.json
cffconvert -f endnote -o ${PWD}/endnote.enw
# etc
2.0.0
Sep 22, 2021
1.3.3
Nov 11, 2019
1.3.2
Nov 05, 2019
1.3.1
Nov 05, 2019
1.3.0
Oct 01, 2019
1.2.2
Oct 01, 2019
1.2.1
Jul 16, 2019
1.2.0
Jun 25, 2019
1.1.0
Apr 04, 2019
1.0.4
Dec 05, 2018
1.0.3
Nov 05, 2018
1.0.2
Oct 09, 2018
1.0.1
Jul 25, 2018
1.0.0
Jul 23, 2018
0.0.5
May 22, 2018
0.0.4
May 22, 2018
0.0.3
May 03, 2018
Wheel compatibility matrix
Files in release
Extras:
Dependencies:
click
(<9,>=7.0)
requests
(<3,>=2.20)
ruamel.yaml
(>=0.16.0)
pykwalify
(>=1.6)
jsonschema
(<4,>=3.0)