Skip to content

An utility to parse bibtex files, in order to recover the missing DOI

License

Notifications You must be signed in to change notification settings

nennigb/doiFromBibtex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python package

DOI From Bibtex - An utility to parse bibtex files, in order to recover the missing DOI


According to the way bibtex files are obtained or build, the DOI field may be missing (e. g. google scholar). This package recovers it. After bibtex file's parsing, DOI are recovered thanks to cross-references requests, using REST API's python version.

The Crossref API polices for polite requests, recommends using an Etiquette object in http requests. This object should list some information on your project and a contact (see below).

Dependencies


Install


Without pip, run:

python3 setup.py install [--user]

For frequent updates (dev), prefer:

python3 setup.py develop [--user]

Using pip3, follow the steps here. First download or clone the repo, then run:

pip3 install path/to/doiFromBibtex-version.tar.gz [--user]

or in editable mode if you want to modify the sources

pip3 install -e path/to/doiFromBibtex

Usage example


To call the package, run:

python3 -m doifrombibtex input_file.bib output_file.bib

This will create the output_file.bib containing missing DOI. To list syntax variant, run;

python3 -m doifrombibtex -h

To run the test, omit input_file parameters:

python3 -m doifrombibtex

To specify your ettiquette (see crossref API recommendation), run:

python3 -m doifrombibtex examples/example.bib out.bib --etiquette 'My Project Name', 'My Project version', 'My Project URL', 'b@b.com'

To parse one or several bibtex entries, run:

python3 -m doifrombibtex /dev/stdin <<<'
@article{xxxx:1998,
	title = ".....",	
	year = ".....",	
	author = "....."
}' /dev/stdout

Here, the output in written on standard ouput (stdout). You may susbstitute with a path to write to a file.

License


This file is part of doiFromBibtex, An utility to parse bibtex files and recover the missing DOI.

doiFromBibtex is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

doiFromBibtex is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with doiFromBibtex. If not, see https://www.gnu.org/licenses/.

About

An utility to parse bibtex files, in order to recover the missing DOI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published