GithubHelp home page GithubHelp logo

bibcure / doi2bib Goto Github PK

View Code? Open in Web Editor NEW
182.0 3.0 27.0 46 KB

get the bibtex string given a doi

Home Page: https://doi2bib.readthedocs.io/

License: MIT License

Python 100.00%
doi crossref bibtex bibtexparser

doi2bib's Introduction

Description

doi2bib is a module of bibcureand scihub2pdf

Install

$ sudo python /usr/bin/pip install doi2bib

or if you want the full version

$ sudo python /usr/bin/pip install bibcure

Features and how to use

Given a DOI number...

$ doi2bib 10.1038/s41524-017-0032-0
  • get bib item given a doi(requires internet connection)

You can easily append a bib into a bibfile, just do

$ doi2bib 10.1038/s41524-017-0032-0 >> file.bib

You also can generate a bibtex from a txt file containing a list of DOIs

$ doi2bib --input file_with_dois.txt --output refs.bib

bibcure

Given a bib file...

$ bibcure -i input.bib -o output.bib
  • check sure the Arxiv items have been published, then update them(requires internet connection)

  • complete all fields(url, journal, etc) of all bib items using DOI number(requires internet connection)

  • find and create DOI number associated with each bib item which has not DOI field(requires internet connection)

  • abbreviate jorunals names

title2bib

Given a title...

$ title2bib An useful paper
  • search papers related and return a bib for the selected paper(requires internet connection)

You can easily append a bib into a bibfile, just do

$ title2bib An useful paper --first >> file.bib

You also can generate a bibtex from a txt file containing a list of "titles"

$ title2bib --input file_with_titles.txt --output refs.bib --first

arxivcheck

Given a arxiv id...

$ arxivcheck 1601.02785
  • check if has been published, and then returns the updated bib (requires internet connection)

Given a title...

$ arxivcheck --title An useful paper published on arxiv

search papers related and return a bib the first item. You can easily append a bib into a bibfile, just do

$ arxivcheck --title An useful paper published on arxiv >> file.bib

You also can interact with results, just pass --ask parameter

$ arxivcheck --ask --title An useful paper published on arxiv

scihub2pdf

Given a bibtex file

$ scihub2pdf -i input.bib

Given a DOI number...

$ scihub2pdf 10.1038/s41524-017-0032-0

Given a title...

$ scihub2bib --title An useful paper

Location folder as argument

$ scihub2pdf -i input.bib -l somefoler/

Use libgen instead sci-hub

$ scihub2pdf -i input.bib --uselibgen

doi2bib's People

Contributors

bertadenes avatar devmessias avatar psavery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doi2bib's Issues

Overwrite elements when fetching lots of dois

Fetching the bib from the doi is simply amazing.

However, in certain situations it might be beneficial to overwrite certain things in the bib.
For instance, it might be nice to add certain tags to the bib-tex file, or to overwrite the reference key.

I would like something like this:

10.1234/12039c key=MyRefKy segment=Chapter1
10.1234/12039d key=HelloWorldExample segment=Chapter2

Error in Cyrillic macros

Thank you very much for this module! It is very, very helpful.

There is something which seems to be a bug. When I use get_bib_from_doi(...) (from doi2bib.crossref) for the doi corresponding to a paper in Russian, the Cyrillic letters are represented as \cyrchar\CYRA (for Cyrillic ะ), \cyrchar\CYRB (for Cyrillic ะ‘), etc. That's fine. But very often I see an error like \cyrchar\{CYRA}. It is not a valid (La)TeX code; symbols \ and { between \cyrchar and CYRA} should be swapped.

For example,

from doi2bib.crossref import get_bib_from_doi
bib = get_bib_from_doi('10.7868/S0023420617030050')
print(bib[1])

gives

...journal = {{\cyrchar\{CYRK}}{\cyrchar\cyro}...

I also reported this bug in the similar project:
davidagraf/doi2bib2#23

page number missing with Physical Review journals

I've noticed recently that when using doi2bib with Physical Review journals the page number is no longer fetched.
For example,

doi2bib 10.1103/PhysRevA.106.043717

results in

@article{Yang_2022,
	doi = {10.1103/physreva.106.043717},
	url = {https://doi.org/10.1103%2Fphysreva.106.043717},
	year = 2022,
	month = {oct},
	publisher = {American Physical Society ({APS})},
	volume = {106},
	number = {4},
	author = {Mengjie Yang and Luojia Wang and Xiaoxiong Wu and Han Xiao and Danying Yu and Luqi Yuan and Xianfeng Chen},
	title = {Concentrated subradiant modes in a one-dimensional atomic array coupled with chiral waveguides},
	journal = {Phys. Rev. A}
}

with no "pages" field. The expected response should also contain
pages = {043717},
I guess this might be a bug on the server, but hopefully there is a way around it.

Abbreviating journal name fails when the full name has uppercase terms in it (e.g. ACM)

You can reproduce the problem with doi:10.1145/3589263

  1. BibTeX generated by crossref.org has a protected term in the journal field: {ACM}

    $ curl http://api.crossref.org/works/10.1145/3589263/transform/application/x-bibtex
    @article{Kuschewski_2023,
     ...
     journal = {Proceedings of the {ACM} on Management of Data}
    }
  2. Because of that, the regular expression to replace the journal field with the abbreviated name fails: https://github.com/bibcure/doi2bib/blob/master/doi2bib/crossref.py#L91

  3. In effect, the BibTeX produced by doi2bib has this malformed line:

    @article{Kuschewski_2023,
     ...
         journal = {Proc. ACM Manag. Data} on Management of Data}
    }
  4. In the end, bibtexparser recognizes the whole section as a comment and not an @article

Extra curly brace in version 0.4

Command

doi2bib https://doi.org/10.1016/j.neuroimage.2010.07.033

Output

@article{Fonov_2011,
	doi = {10.1016/j.neuroimage.2010.07.033},
	url = {https://doi.org/10.1016%2Fj.neuroimage.2010.07.033},
	year = 2011,
	month = {jan},
	publisher = {Elsevier {BV}},
	volume = {54},
	number = {1},
	pages = {313--327},
	author = {Vladimir Fonov and Alan C. Evans and Kelly Botteron and C. Robert Almli and Robert C. McKinstry and D. Louis Collins},
	title = {Unbiased average age-appropriate atlases for pediatric studies},
	journal = {NeuroImage}}
}

Note that journal contains unbalanced curly braces.

bib label same as doi

Thanks for this amazing script. I am trying to use this in my markdown scripts. Currently the label on bibtex shows as "@Article{Li2013" or something like it. Wondering if the label can be same as doi itself? Then it will be much easier to crossref in markdown scripts eg. "@Article{10.1038/s41524-017-0032-0"

why doi2bib does not give the journal name?

I tried the following command, and no longer journal name appears with the current version of bibcure.

doi2bib 10.1016/j.jenvrad.2016.08.002

and the result is as follows.

@Article{2016,
doi = {10.1016/j.jenvrad.2016.08.002},
url = {https://doi.org/10.1016%2Fj.jenvrad.2016.08.002},
year = 2016,
month = {nov},
publisher = {Elsevier {BV}},
volume = {164},
pages = {232--238},
author = {Jonathan L. Burnett and Brian D. Milbrath},
title = {Radionuclide observables for the Platte underground nuclear explosive test on 14 April 1962}
}

Previously, it works well.

Can anyone help me to solve this issue?

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.