Package: citation-url
citation-urlParse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc.This module has a singleparse()function that takes in a URL and gives back
a parse status (success, unknown, or irreconcilable), a prefix, and
an identifier. If the status is unknown or irreconcilable, the prefix will
be left asNoneand the identifier will match the input:>>>fromcitation_urlimportparse,Status>>>parse("https://joss.theoj.org/papers/10.21105/joss.01708")(Status.success,'doi','10.21105/joss.01708')>>>parse("http://www.ncbi.nlm.nih.gov/pubmed/34739845")(Status.success,'pubmed','34739845')>>>parse("https://example.com/true-garbage")(Status.unknown,None,'https://example.com/true-garbage')>>>parse("https://example.com/true-garbage")(Status.unknown,None,'https://example.com/true-garbage')>>>parse("http://msb.embopress.org/content/13/11/954.full.pdf")(Status.irreconcilable,None,'http://msb.embopress.org/content/13/11/954.full.pdf')🕵️ Why?I wanted to be able to curate a list of papers inZotero,Mendeley, or any
other modern citation manager, make an XML export in the EndNote format, extract
and normalize the messy contents in theelectronic-resource-num,text-urls,
andpdf-urlsfields, then ensure that there are corresponding entries
onWikidatausing the Su Lab'sWikidata Integrator.Reuse this functionality with:$python-mcitation_url.endnote--help🚀 InstallationThe most recent release can be installed fromPyPIwith:$pipinstallcitation_urlThe most recent code and data can be installed directly from GitHub with:$pipinstallgit+https://github.com/cthoyt/citation-url.git👐 ContributingContributions, whether filing an issue, making a pull request, or forking, are appreciated. SeeCONTRIBUTING.mdfor more information on getting involved.👋 Attribution⚖️ LicenseThe code in this package is licensed under the MIT License.🍪 CookiecutterThis package was created with@audreyfeldroy'scookiecutterpackage using@cthoyt'scookiecutter-snekpacktemplate.🛠️ For DevelopersSee developer instrutionsThe final section of the README is for if you want to get involved by making a code contribution.Development InstallationTo install in development mode, use the following:$gitclonegit+https://github.com/cthoyt/citation-url.git
$cdcitation-url
$pipinstall-e.🥼 TestingAfter cloning the repository and installingtoxwithpip install tox, the unit tests in thetests/folder can be
run reproducibly with:$toxAdditionally, these tests are automatically re-run with each commit in aGitHub Action.📖 Building the Documentation$tox-edocs📦 Making a ReleaseAfter installing the package in development mode and installingtoxwithpip install tox, the commands for making a new release are contained within thefinishenvironment
intox.ini. Run the following from the shell:$tox-efinishThis script does the following:UsesBump2Versionto switch the version number in thesetup.cfgandsrc/citation_url/version.pyto not have the-devsuffixPackages the code in both a tar archive and a wheelUploads to PyPI usingtwine. Be sure to have a.pypircfile configured to avoid the need for manual input at this
stepPush to GitHub. You'll need to make a release going with the commit where the version was bumped.Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can
usetox -e bumpversion minorafter.