-
Notifications
You must be signed in to change notification settings - Fork 18
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
add citation parsing for different formats #229
add citation parsing for different formats #229
Conversation
This pull request has been linked to Clubhouse Story #151021: Easy citation data fetching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~ left some code style questions, feel free to ignore
backend/napari.py
Outdated
extra_metadata['citation'] = citation | ||
citation_file = get_file(download_url, "CITATION.cff") | ||
if citation_file is not None: | ||
extra_metadata['citations'] = (get_citation(citation_file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the get_citation
call wrapped in parentheses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
backend/napari.py
Outdated
|
||
return extra_metadata | ||
|
||
|
||
def get_citation(citation_str: str) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it weird that this is named get_citation
(singular) as opposed to get_citations
(plural) since it is referred to in plural for everywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! it should have been renamed to accommodate the dictionary
Added parsing of citation into RIS and BibTex format, pending on APA format on discussion here: citation-file-format/cffconvert#157