Giter Club home page Giter Club logo

betterbib's Introduction

betterbib

CircleCI codecov Code style: black awesome PyPI pyversions PyPi Version GitHub stars PyPi downloads

BibTeX files are typically manually maintained and thus often contain inconsistencies, mistakes, or are missing information. betterbib helps maintaining your BibTeX files by comparing them with online sources and correcting whatever entries are found faulty.

Simply run

betterbib in.bib out.bib

to improve your BibTeX file with default settings. For example, the input BibTeX

@article {krylov,
  author = {Liesen and Gaul and Nabben},
  title = {Framework Deflation Krylov Augmented}
}

is converted to

@article{krylov,
 author = {Gaul, André and Gutknecht, Martin H. and Liesen, Jörg and Nabben, Reinhard},
 title = {A Framework for Deflated and Augmented {Krylov} Subspace Methods},
 doi = {10.1137/110820713},
 number = {2},
 pages = {495-518},
 source = {Crossref},
 url = {https://doi.org/10.1137/110820713},
 volume = {34},
 journal = {SIAM J. Matrix Anal. \& Appl.},
 publisher = {Society for Industrial \& Applied Mathematics (SIAM)},
 issn = {0895-4798, 1095-7162},
 year = {2013},
 month = jan,
}

Tools

All of the following tools can read from standard input and write to standard output, so you can concatenate them to get exactly what you want. For example, the above betterbib command is equivalent to

betterbib-sync in.bib | betterbib-journal-abbrev | betterbib-format -b - out.bib

Sync

betterbib fetches data from

All betterbib-sync command-line options are explained in betterbib-sync -h.

Format

The tool

betterbib-format in.bib out.bib

allows you to apply consistent formatting to you BibTeX file. See -h/--help for options.

(Un)abbreviate journal names

The tool

betterbib-journal-abbrev in.bib out.bib

allows you to apply consistent abbreviation of journal names. See -h/--help for options.

Custom journal abbreviations

To use custom abbrebiations for journal names, create a file as a JSON dictionary, and provide that as a command line argument with --extra-abbrev-file. For example, if the file correct_pnas.json is:

{"PNAS": "Proc. Natl. Acad. Sci.  U.S.A."}

and you call betterbib-journal-abbrev --extra-abbrev-file=correct_pnas.json, this will replace any bibtex entries listed with journal "PNAS" with the correct abbreviation.

This option is included in the betterbib and betterbib-journal-abbrev commands.

When combined with the --long-journal-names option, this will override default options only if both have the same abbreviation.

Configuration

In BibTeX titles, some words need to be protected by curly brackets such that they are capitalized correctly, e.g., {Einstein}. betterbib automatically recognizes some of them (if they are in the default dictionary, like Einstein), but you might want to add some. To this end, create the config file

~/.config/betterbib/config.ini

and fill it with, e.g.,

[DICTIONARY]
add=Arnoldi,
    Bernstein,
    Boolean,
    Chebyshev,
    Hermitian

remove=hermitian,
   boolean

Installation

betterbib is available from the Python Package Index, so simply do

pip install betterbib

to install.

Testing

To run the betterbib unit tests, check out this repository and type

pytest

License

betterbib is published under the MIT license.

betterbib's People

Contributors

blechta avatar dwhswenson avatar nschloe avatar ohjeah avatar schoyen avatar tbabej avatar thorade avatar

Watchers

 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.