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

scholarly.fill() doesnot completely fill author publication entry but it completely fills search publication search snippet. So I am not able to get bibtex citation with scholarly.bibtex() from author publication entry #557

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scholarly/publication_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ def fill(self, publication: Publication)->Publication:
publication['mandates'] = []
self._fill_public_access_mandates(publication)

scholar_bib_id = publication['url_related_articles'].split("q=related:")[1].split(":")[0]
url_scholarbib = f"/scholar?hl=en&q=info:{scholar_bib_id}:scholar.google.com/&output=cite&scirp=0&hl=en"
publication['url_scholarbib']=url_scholarbib

bibtex_url = self._get_bibtex(publication['url_scholarbib'])
bibtex = self.nav._get_page(bibtex_url)
parser = bibtexparser.bparser.BibTexParser(common_strings=True)
parsed_bib = remap_bib(bibtexparser.loads(bibtex,parser).entries[-1], _BIB_MAPPING, _BIB_DATATYPES)
publication['bib'].update(parsed_bib)
publication['filled'] = True
elif publication['source'] == PublicationSource.PUBLICATION_SEARCH_SNIPPET:
bibtex_url = self._get_bibtex(publication['url_scholarbib'])
Expand Down