Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOI resolution fails #21

Open
jesusff opened this issue May 6, 2024 · 0 comments
Open

DOI resolution fails #21

jesusff opened this issue May 6, 2024 · 0 comments

Comments

@jesusff
Copy link

jesusff commented May 6, 2024

DOI request return value does not include newlines anymore (?). These newlines were used to parse DOI information in function doi2bib:

def doi2dic(doi):
url = "http://dx.doi.org/" + doi
headers = {"accept": "application/x-bibtex"}
r = requests.get(url, headers = headers)
rval = r.text.replace('@article{', '')
for char in '}{\t':
rval = rval.replace(char, '')
rdict = {}
for item in rval.split('\n'):
if '=' in item:
kv = item.split('=')
rdict[kv[0].strip()] = kv[1].strip().strip(',')
if 'and' in rdict['author']:
rdict['author'] = rdict['author'].split(' and ')[0] + ' et al.'
return(rdict)

DOI resolution has been disabled by default in 559537b until this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant