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

add citation parsing for different formats #229

Merged
merged 2 commits into from
Aug 9, 2021

Conversation

liu-ziyang
Copy link
Contributor

Added parsing of citation into RIS and BibTex format, pending on APA format on discussion here: citation-file-format/cffconvert#157

@shortcut-integration
Copy link

This pull request has been linked to Clubhouse Story #151021: Easy citation data fetching.

Copy link
Contributor

@klai95 klai95 left a 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!

Copy link
Collaborator

@codemonkey800 codemonkey800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

Copy link
Member

@kne42 kne42 left a 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

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))
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!


return extra_metadata


def get_citation(citation_str: str) -> dict:
Copy link
Member

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

Copy link
Contributor Author

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

@liu-ziyang liu-ziyang merged commit 45a55c7 into main Aug 9, 2021
@liu-ziyang liu-ziyang deleted the ziyangliu/ch151021/easy-citation-data-fetching branch August 9, 2021 23:12
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

Successfully merging this pull request may close these issues.

4 participants