SuLab / WikidataIntegrator

A Wikidata Python module integrating the MediaWiki API and the Wikidata SPARQL endpoint
MIT License
244 stars 46 forks source link

Enable creation of the Publication by arXiv identifier #140

Closed cthoyt closed 4 years ago

cthoyt commented 4 years ago

This PR mainly adds the function wikidataintegrator.wdi_helpers.publication.arxiv_api_to_publication and integrates it with the wikidataintegrator.wdi_helpers.publication.Publication class to allow specifying the source/idtype as arxiv.

I ran the code

python -m wikidataintegrator.wdi_helpers.publication 2006.08589 --source arxiv --idtype arxiv

and was happy greeted by

Successfully logged in as Cthoyt
2006.08589,Q96335314,,True

and my shiny new WikiData entry https://www.wikidata.org/wiki/Q96335314.

This PR adds a few minor tweaks as well: