sckott / habanero

client for Crossref search API

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Month returned by habanero.cn.content_negotiation(ids = doi) no longer in curly brackets

tardigradus opened this issue · comments

With Python 3.6.8 and habanero 0.7.4, I have been successfully downloading BibTeX files and parsing them with BibtexParser for the last couple of years. However, some time between the middle of September 2023 and now, the format of the BibTex file I get via habanero.cn.content_negotiation(ids = doi) changed: The value of the field month is no longer enclosed in curly brackets.

So whereas in the middle of September 2023 I got:

@article{Zupan2023,
 author = {Hana Zupan and Frederick Heinz and Bettina G. Keller},
 doi = {10.1139/cjc-2022-0282},
 journal = {Canadian Journal of Chemistry},
 month = {sep},
 number = {9},
 pages = {710--724},
 publisher = {Canadian Science Publishing},
 title = {Grid-based state space exploration for molecular binding},
 url = {https://doi.org/10.1139/cjc-2022-0282},
 volume = {101},
 year = {2023}
}

I now get

@article{Zupan2023,
 author = {Hana Zupan and Frederick Heinz and Bettina G. Keller},
 doi = {10.1139/cjc-2022-0282},
 journal = {Canadian Journal of Chemistry},
 month = sep,
 number = {9},
 pages = {710--724},
 publisher = {Canadian Science Publishing},
 title = {Grid-based state space exploration for molecular binding},
 url = {https://doi.org/10.1139/cjc-2022-0282},
 volume = {101},
 year = {2023}
}

This is then causing BibtexParser to fail.

I assume this is not directly a problem with habanero, but this a known issue?

Edit: doi2bib has the same issue: https://www.doi2bib.org/bib/10.1139/cjc-2022-0282

Thanks and sorry about the delay! Life events made it hard to do any paid or non-paid work. Having a look

I can replicate the issue myself.

It does seem like a bare string like sep shouldn't be allowed given the text in https://www.bibtex.org/Format/

However, I'm not sure it's within scope to fix these issues in this package. I"ll check if it can be done easily

@tardigradus Okay, you can try the fixed version on main branch here - install from github, not on pypi yet.

Sorry for not getting round to this earlier.

I assumed that version 1.2.6 contains the fixes you made, so I installed that with pip. I also had to update bibtexparser to version 2, but I now get the month in curlies, as desired. Thanks for fixing.