Giter Site home page Giter Site logo

joenio / cffconvert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from citation-file-format/cffconvert

0.0 0.0 0.0 2.34 MB

Command line program to validate and convert CITATION.cff files.

License: Apache License 2.0

Python 98.72% TeX 0.80% HTML 0.47% Dockerfile 0.01%

cffconvert's Introduction

cffconvert

Zenodo DOI testing linting Code Smells PyPI Badge CII Best Practices Research Software Directory fair-software.eu FAIR checklist badge Docker Pulls PyPI - Downloads PePy GitHub commits since latest release (by SemVer including pre-releases)

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.3.0 unreleased
1.2.0 Zenodo DOI
1.1.0 Zenodo DOI
1.0.3 Zenodo DOI
1.0.2 Zenodo DOI
1.0.1 Zenodo DOI

Supported output formats

  1. APA-like plaintext
  2. BibTeX
  3. CodeMeta
  4. EndNote
  5. RIS
  6. schema.org JSON
  7. 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.

Docker

cffconvert is available from DockerHub: https://hub.docker.com/r/citationcff/cffconvert

Example usage:

docker run --rm -v $PWD:/app citationcff/cffconvert --validate
docker run --rm -v $PWD:/app citationcff/cffconvert --version
docker run --rm -v $PWD:/app citationcff/cffconvert --help
# etc

pre-commit hook

cffconvert is also available as a pre-commit hook. Add the following to your .pre-commit-config.yaml file to start validating your CITATION.cff automatically whenever you issue a git commit:

repos:
  - repo: https://github.com/citation-file-format/cffconvert
    rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c
    hooks:
      - id: validate-cff

Command line interface

See cffconvert's options:

cffconvert --help

Shows:

Usage: cffconvert [OPTIONS]

  Command line program to validate and convert CITATION.cff files.

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.
  --verbose                       Control output verbosity.

  If this program is useful to you, consider giving it a star on GitHub:
  https://github.com/citation-file-format/cffconvert

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

cffconvert's People

Contributors

jspaaks avatar wleoncio avatar sdruskat avatar tommos0 avatar sverhoeven avatar dependabot[bot] avatar zmoon avatar kurtmckee avatar abelsiqueira avatar andreaschrader avatar musicinmybrain avatar firefly-cpp avatar monperrus avatar ots22 avatar nialov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.