Coder Social home page Coder Social logo

doi2bib's Introduction

doi2bib Build status

Small CLI to get a bibtex entry from a DOI, an arXiv ID or a PubMed ID.

Just so you know, there is now Zotero BIB on the browser that can do this (and more). I will keep maintaining doi2bib though, since it is an integral part my workflow.

Usage:

$ doi2bib --help=plain
NAME
   doi2bib - A little CLI tool to get the bibtex entry for a given DOI,
   arXiv or PubMed ID.

SYNOPSIS
   doi2bib [OPTION]... [ID]

ARGUMENTS
   ID  A DOI, an arXiv ID or a PubMed ID. The tool tries to automatically
       infer what kind of ID you are using. You can force the cli to
       lookup a DOI by using the form 'doi:ID' or an arXiv ID by using
       the form 'arXiv:ID'. PubMed IDs always start with 'PMC'.

OPTIONS
   -f FILE, --file=FILE
       With this flag, the tool reads the file and process its lines
       sequentially, treating them as DOIs, arXiv IDs or PubMedIDs.
       Errors will be printed on standard error but will not terminate
       the operation.

   --help[=FMT] (default=auto)
       Show this help in format FMT. The value FMT must be one of `auto',
       `pager', `groff' or `plain'. With `auto', the format is `pager` or
       `plain' whenever the TERM env var is `dumb' or undefined.

   -o OUTPUT, --output=OUTPUT (absent=stdout)
       Append the bibtex output to the specified file. It will create the
       file if it does not exist.

   --version
       Show version information.

EXIT STATUS
   doi2bib exits with the following status:

   0   on success.

   124 on command line parsing errors.

   125 on unexpected internal errors (bugs).

BUGS
   Report bugs to https://github.com/mseri/doi2bib/issues

It will retrieve the bibtex entry, using the published details when possible.

Examples of use

The bibtex entry is printed on standard output:

$ doi2bib 10.1007/s10569-019-9946-9
$ doi2bib 1902.00436
$ doi2bib arXiv:1609.01724
$ doi2bib PMC2883744

The bibtex entry is saved in the bibliography.bib file:

$ doi2bib doi:10.4171/JST/226 -o "bibliography.bib"

This will create the file if not present or append the bibliography to the file.

You can batch-process lists of entries by listing them line by line in a file and using the --file option.

Installation

Each release comes with attached binaries for windows, mac and linux. You can simply unpack the binary and place in a folder accessible by your terminal of choice.

Troubleshooting

If on macos you get a Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib failure, you will need to install gmp. Macports users can do it via port install gmp and homebrew users via breww install gmp.

Building instruction

To build the package yourself, the most immediate way is tu use opam:

$ opam install doi2bib

To run the tests, clone this repository and from of the root of the project run

$ opam install --deps-only .    # first time only
$ dune runtest -p doi2bib

API references

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.