Skip to content

Commit

Permalink
Merge b9395ca into d5b4e84
Browse files Browse the repository at this point in the history
  • Loading branch information
fenekku committed Jun 19, 2020
2 parents d5b4e84 + b9395ca commit b48f109
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Authors
- Alexander Ioannidis
- Antoine Lambert
- Bruno Marmol
- Guillaume Viger
- Jiri Kuncar
- Lars Holm Nielsen
- Pedro Gaudencio
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
Changes
=======

Version 1.1.7 (2020-06-19)

- Updates support for Software Heritage identifiers with new qualifiers.
- Adds support for ROR identifiers

Version 1.1.6 (2020-05-07)

- Deprecates Python versions lower than 3.6.0. Now supporting 3.6.0 and 3.7.0.
Expand Down
60 changes: 30 additions & 30 deletions idutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
"""See http://en.wikipedia.org/wiki/Digital_object_identifier."""

handle_regexp = re.compile(
"(hdl:\s*|(?:https?://)?hdl\.handle\.net/)?"
"([^/\.]+(\.[^/\.]+)*/.*)$",
r"(hdl:\s*|(?:https?://)?hdl\.handle\.net/)?"
r"([^/\.]+(\.[^/\.]+)*/.*)$",
flags=re.I
)
"""See http://handle.net/rfc/rfc3651.html.
Expand All @@ -161,90 +161,90 @@
"""

arxiv_post_2007_regexp = re.compile(
"(arxiv:)?(\d{4})\.(\d{4,5})(v\d+)?$",
r"(arxiv:)?(\d{4})\.(\d{4,5})(v\d+)?$",
flags=re.I
)
"""See http://arxiv.org/help/arxiv_identifier and
http://arxiv.org/help/arxiv_identifier_for_services."""

arxiv_pre_2007_regexp = re.compile(
"(arxiv:)?([a-z\-]+)(\.[a-z]{2})?(/\d{4})(\d+)(v\d+)?$",
r"(arxiv:)?([a-z\-]+)(\.[a-z]{2})?(/\d{4})(\d+)(v\d+)?$",
flags=re.I
)
"""See http://arxiv.org/help/arxiv_identifier and
http://arxiv.org/help/arxiv_identifier_for_services."""

arxiv_post_2007_with_class_regexp = re.compile(
"(arxiv:)?(?:[a-z\-]+)(?:\.[a-z]{2})?/(\d{4})\.(\d{4,5})(v\d+)?$",
r"(arxiv:)?(?:[a-z\-]+)(?:\.[a-z]{2})?/(\d{4})\.(\d{4,5})(v\d+)?$",
flags=re.I
)
"""Matches new style arXiv ID, with an old-style class specification;
technically malformed, however appears in real data."""

hal_regexp = re.compile(
"(hal:|HAL:)?([a-z]{3}[a-z]*-|(sic|mem|ijn)_)\d{8}(v\d+)?$"
)
r"(hal:|HAL:)?([a-z]{3}[a-z]*-|(sic|mem|ijn)_)\d{8}(v\d+)?$"
)
"""Matches HAL identifiers (sic mem and ijn are old identifiers form)."""

ads_regexp = re.compile("(ads:|ADS:)?(\d{4}[A-Za-z]\S{13}[A-Za-z.:])$")
ads_regexp = re.compile(r"(ads:|ADS:)?(\d{4}[A-Za-z]\S{13}[A-Za-z.:])$")
"""See http://adsabs.harvard.edu/abs_doc/help_pages/data.html"""

pmcid_regexp = re.compile("PMC\d+$", flags=re.I)
pmcid_regexp = re.compile(r"PMC\d+$", flags=re.I)
"""PubMed Central ID regular expression."""

pmid_regexp = re.compile("(pmid:)?(\d+)$", flags=re.I)
pmid_regexp = re.compile(r"(pmid:)?(\d+)$", flags=re.I)
"""PubMed ID regular expression."""

ark_suffix_regexp = re.compile("ark:/\d+/.+$")
ark_suffix_regexp = re.compile(r"ark:/\d+/.+$")
"""See http://en.wikipedia.org/wiki/Archival_Resource_Key and
https://confluence.ucop.edu/display/Curation/ARK."""

lsid_regexp = re.compile("urn:lsid:[^:]+(:[^:]+){2,3}$", flags=re.I)
lsid_regexp = re.compile(r"urn:lsid:[^:]+(:[^:]+){2,3}$", flags=re.I)
"""See http://en.wikipedia.org/wiki/LSID."""

orcid_urls = ["http://orcid.org/", "https://orcid.org/"]

gnd_regexp = re.compile(
"(gnd:|GND:)?("
"(1|10)\d{7}[0-9X]|"
"[47]\d{6}-\d|"
"[1-9]\d{0,7}-[0-9X]|"
"3\d{7}[0-9X]"
")")
r"(gnd:|GND:)?("
r"(1|10)\d{7}[0-9X]|"
r"[47]\d{6}-\d|"
r"[1-9]\d{0,7}-[0-9X]|"
r"3\d{7}[0-9X]"
r")")
"""See https://www.wikidata.org/wiki/Property:P227."""

gnd_resolver_url = "http://d-nb.info/gnd/"

sra_regexp = re.compile("[SED]R[APRSXZ]\d+$")
sra_regexp = re.compile(r"[SED]R[APRSXZ]\d+$")
"""Sequence Read Archive regular expression."""

bioproject_regexp = re.compile("PRJ(NA|EA|EB|DB)\d+$")
bioproject_regexp = re.compile(r"PRJ(NA|EA|EB|DB)\d+$")
"""BioProject regular expression."""

biosample_regexp = re.compile("SAM(N|EA|D)\d+$")
biosample_regexp = re.compile(r"SAM(N|EA|D)\d+$")
"""BioSample regular expression."""

ensembl_regexp = re.compile("({prefixes})(E|FM|G|GT|P|R|T)\d{{11}}$".format(
ensembl_regexp = re.compile(r"({prefixes})(E|FM|G|GT|P|R|T)\d{{11}}$".format(
prefixes="|".join(ENSEMBL_PREFIXES)))
"""Ensembl regular expression."""

uniprot_regexp = re.compile("([A-N,R-Z][0-9]([A-Z][A-Z,0-9]{2}[0-9]){1,2})|"
"([O,P,Q][0-9][A-Z,0-9]{3}[0-9])(\.\d+)?$")
uniprot_regexp = re.compile(r"([A-N,R-Z][0-9]([A-Z][A-Z,0-9]{2}[0-9]){1,2})|"
r"([O,P,Q][0-9][A-Z,0-9]{3}[0-9])(\.\d+)?$")
"""UniProt regular expression."""

refseq_regexp = re.compile("((AC|NC|NG|NT|NW|NM|NR|XM|XR|AP|NP|YP|XP|WP)_|"
"NZ_[A-Z]{4})\d+(\.\d+)?$")
refseq_regexp = re.compile(r"((AC|NC|NG|NT|NW|NM|NR|XM|XR|AP|NP|YP|XP|WP)_|"
r"NZ_[A-Z]{4})\d+(\.\d+)?$")
"""RefSeq regular expression."""

genome_regexp = re.compile("GC[AF]_\d+\.\d+$")
genome_regexp = re.compile(r"GC[AF]_\d+\.\d+$")
"""GenBank or RefSeq genome assembly accession."""

ascl_regexp = re.compile("^ascl:[0-9]{4}\.[0-9]{3,4}$", flags=re.I)
ascl_regexp = re.compile(r"^ascl:[0-9]{4}\.[0-9]{3,4}$", flags=re.I)
"""ASCL regular expression."""

swh_regexp = re.compile(
"swh:1:(cnt|dir|rel|rev|snp):[0-9a-f]{40}"
"(;(origin|visit|anchor|path|lines)=\S+)*$"
r"swh:1:(cnt|dir|rel|rev|snp):[0-9a-f]{40}"
r"(;(origin|visit|anchor|path|lines)=\S+)*$"
)
"""Matches Software Heritage identifiers."""

Expand Down
4 changes: 1 addition & 3 deletions idutils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@
and parsed by ``setup.py``.
"""

from __future__ import absolute_import, print_function

__version__ = "1.1.6"
__version__ = "1.1.7"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of IDUtils
# Copyright (C) 2015, 2016 CERN.
# Copyright (C) 2015-2020 CERN.
#
# IDUtils is free software; you can redistribute it and/or modify
# it under the terms of the Revised BSD License; see LICENSE file for
Expand Down

0 comments on commit b48f109

Please sign in to comment.