# `cffconvert`
[![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1162057.svg)](https://doi.org/10.5281/zenodo.1162057)
[![testing](https://github.com/citation-file-format/cff-converter-python/actions/workflows/testing.yml/badge.svg)](https://github.com/citation-file-format/cff-converter-python/actions/workflows/testing.yml)
[![linting](https://github.com/citation-file-format/cff-converter-python/actions/workflows/linting.yml/badge.svg)](https://github.com/citation-file-format/cff-converter-python/actions/workflows/linting.yml)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=citation-file-format_cff-converter-python&metric=code_smells)](https://sonarcloud.io/dashboard?id=citation-file-format_cff-converter-python)
[![PyPI Badge](https://img.shields.io/pypi/v/cffconvert.svg?colorB=blue)](https://pypi.python.org/pypi/cffconvert/)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1811/badge)](https://bestpractices.coreinfrastructure.org/projects/1811)
[![Research Software Directory](https://img.shields.io/badge/rsd-cffconvert-00a3e3.svg)](https://www.research-software.nl/software/cff-converter-python)
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)
Command line program to validate and convert [`CITATION.cff`](https://github.com/citation-file-format/citation-file-format) files.
Supported input versions of the Citation File Format:
| Citation File Format schema version | Link to Zenodo release |
| --- | --- |
| `1.2.0` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5171937.svg)](https://doi.org/10.5281/zenodo.5171937) |
| `1.1.0` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4813122.svg)](https://doi.org/10.5281/zenodo.4813122) |
| `1.0.3` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1222163.svg)](https://doi.org/10.5281/zenodo.1222163) |
| `1.0.2` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1120256.svg)](https://doi.org/10.5281/zenodo.1120256) |
| `1.0.1` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1117789.svg)](https://doi.org/10.5281/zenodo.1117789) |
Supported output formats:
1. APA-like plaintext
1. BibTeX
3. CodeMeta
4. EndNote
1. RIS
1. schema.org JSON
1. Zenodo JSON
`cffconvert` does not support converting items from `references` or `preferred-citation` keys at the moment.
## Installing
To install in user space,
```shell
python3 -m pip install --user cffconvert
```
Ensure that the user space directory `~/.local/bin/` is on the `PATH`.
```shell
which cffconvert
```
should now return the location of the program.
See [docs/alternative-install-options.md](docs/alternative-install-options.md) for alternative install options.
## Command line interface
See `cffconvert`'s options:
```shell
cffconvert --help
```
Shows:
```shell
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
```shell
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
```shell
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:
```shell
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
```shell
# 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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/citation-file-format/cff-converter-python",
"name": "cffconvert",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "citation,credit,CITATION.cff,BibTeX,EndNote,RIS,CodeMeta,Zenodo",
"author": "Jurriaan H. Spaaks",
"author_email": "j.spaaks@esciencecenter.nl",
"download_url": "https://files.pythonhosted.org/packages/ac/7e/cd1018d4073e83b852c478bab20a0855944c0122e9bf843fd17abcfd9ac7/cffconvert-2.0.0.tar.gz",
"platform": "",
"description": "# `cffconvert`\n\n[![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1162057.svg)](https://doi.org/10.5281/zenodo.1162057)\n[![testing](https://github.com/citation-file-format/cff-converter-python/actions/workflows/testing.yml/badge.svg)](https://github.com/citation-file-format/cff-converter-python/actions/workflows/testing.yml)\n[![linting](https://github.com/citation-file-format/cff-converter-python/actions/workflows/linting.yml/badge.svg)](https://github.com/citation-file-format/cff-converter-python/actions/workflows/linting.yml)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=citation-file-format_cff-converter-python&metric=code_smells)](https://sonarcloud.io/dashboard?id=citation-file-format_cff-converter-python)\n[![PyPI Badge](https://img.shields.io/pypi/v/cffconvert.svg?colorB=blue)](https://pypi.python.org/pypi/cffconvert/)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1811/badge)](https://bestpractices.coreinfrastructure.org/projects/1811)\n[![Research Software Directory](https://img.shields.io/badge/rsd-cffconvert-00a3e3.svg)](https://www.research-software.nl/software/cff-converter-python)\n[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)\n\nCommand line program to validate and convert [`CITATION.cff`](https://github.com/citation-file-format/citation-file-format) files.\n\nSupported input versions of the Citation File Format:\n\n| Citation File Format schema version | Link to Zenodo release |\n| --- | --- |\n| `1.2.0` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5171937.svg)](https://doi.org/10.5281/zenodo.5171937) |\n| `1.1.0` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4813122.svg)](https://doi.org/10.5281/zenodo.4813122) |\n| `1.0.3` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1222163.svg)](https://doi.org/10.5281/zenodo.1222163) |\n| `1.0.2` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1120256.svg)](https://doi.org/10.5281/zenodo.1120256) |\n| `1.0.1` | [![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1117789.svg)](https://doi.org/10.5281/zenodo.1117789) |\n\nSupported output formats:\n\n1. APA-like plaintext\n1. BibTeX\n3. CodeMeta\n4. EndNote\n1. RIS\n1. schema.org JSON\n1. Zenodo JSON\n\n`cffconvert` does not support converting items from `references` or `preferred-citation` keys at the moment.\n\n## Installing\n\nTo install in user space, \n\n```shell\npython3 -m pip install --user cffconvert\n```\nEnsure that the user space directory `~/.local/bin/` is on the `PATH`.\n\n```shell\nwhich cffconvert\n```\nshould now return the location of the program.\n\nSee [docs/alternative-install-options.md](docs/alternative-install-options.md) for alternative install options.\n\n## Command line interface\n\nSee `cffconvert`'s options:\n\n```shell\ncffconvert --help\n```\n\nShows:\n\n```shell\nUsage: cffconvert [OPTIONS]\n\nOptions:\n -i, --infile PATH Path to the CITATION.cff input file. If this\n option is omitted, './CITATION.cff' is used.\n -o, --outfile PATH Path to the output file.\n -f, --format [apalike|bibtex|cff|codemeta|endnote|ris|schema.org|zenodo]\n Output format.\n -u, --url TEXT URL to the CITATION.cff input file.\n -h, --help Show help and exit.\n --show-trace Show error trace.\n --validate Validate the CITATION.cff file and exit.\n --version Print version and exit.\n```\n\n## Example usage\n\n### Validating a local CITATION.cff file\n\n```shell\ncffconvert --validate\ncffconvert --validate -i CITATION.cff\ncffconvert --validate -i ${PWD}/CITATION.cff\ncffconvert --validate -i ../some-other-dir/CITATION.cff\n```\n\n### Validating a remote CITATION.cff file\n\n```shell\ncffconvert --validate --url https://github.com/<org>/<repo>\ncffconvert --validate --url https://github.com/<org>/<repo>/commit/<sha>\ncffconvert --validate --url https://github.com/<org>/<repo>/tree/<sha>\ncffconvert --validate --url https://github.com/<org>/<repo>/tree/<tag>\ncffconvert --validate --url https://github.com/<org>/<repo>/tree/<branch>\n```\n\n\n### Converting metadata to other formats\n\nIf there is a valid `CITATION.cff` file in the current directory, you can convert to various other formats and \nprint the result on standard out with:\n\n```shell\ncffconvert -f bibtex\ncffconvert -f codemeta\ncffconvert -f endnote\ncffconvert -f ris\ncffconvert -f schema.org\ncffconvert -f zenodo\ncffconvert -f apalike\n```\n\n### Writing to a file\n\n```shell\n# with i/o redirection:\ncffconvert -f bibtex > bibtex.bib\ncffconvert -f zenodo > zenodo.json\ncffconvert -f endnote > ${PWD}/endnote.enw\n# etc\n\n# without i/o redirection\ncffconvert -f bibtex -o bibtex.bib\ncffconvert -f zenodo -o zenodo.json\ncffconvert -f endnote -o ${PWD}/endnote.enw\n# etc\n```\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Command line program to validate and convert CITATION.cff files.",
"version": "2.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/citation-file-format/cff-converter-python/issues",
"Homepage": "https://github.com/citation-file-format/cff-converter-python",
"Source": "https://github.com/citation-file-format/cff-converter-python"
},
"split_keywords": [
"citation",
"credit",
"citation.cff",
"bibtex",
"endnote",
"ris",
"codemeta",
"zenodo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "42ae28c3d933b4343f61cc5d63748b53746e5d73b1f66c88e7a93477f22b8909",
"md5": "e0267c13c91e0b77f8e63f371152a6e4",
"sha256": "573c825e4e16173d99396dc956bd22ff5d4f84215cc16b6ab05299124f5373bb"
},
"downloads": -1,
"filename": "cffconvert-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e0267c13c91e0b77f8e63f371152a6e4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 183525,
"upload_time": "2021-09-22T15:38:27",
"upload_time_iso_8601": "2021-09-22T15:38:27.278004Z",
"url": "https://files.pythonhosted.org/packages/42/ae/28c3d933b4343f61cc5d63748b53746e5d73b1f66c88e7a93477f22b8909/cffconvert-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac7ecd1018d4073e83b852c478bab20a0855944c0122e9bf843fd17abcfd9ac7",
"md5": "3e89912467d1e10d247aef8b909976ae",
"sha256": "b4379ee415c6637dc9e3e7ba196605cb3cedcea24613e4ea242c607d9e98eb50"
},
"downloads": -1,
"filename": "cffconvert-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "3e89912467d1e10d247aef8b909976ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 147680,
"upload_time": "2021-09-22T15:38:29",
"upload_time_iso_8601": "2021-09-22T15:38:29.063716Z",
"url": "https://files.pythonhosted.org/packages/ac/7e/cd1018d4073e83b852c478bab20a0855944c0122e9bf843fd17abcfd9ac7/cffconvert-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-09-22 15:38:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "citation-file-format",
"github_project": "cff-converter-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cffconvert"
}