diff options
author | bnewbold <bnewbold@archive.org> | 2020-04-17 21:22:48 +0000 |
---|---|---|
committer | bnewbold <bnewbold@archive.org> | 2020-04-17 21:22:48 +0000 |
commit | e749b576bdb9bbec3bcef7e4e389e7fbbf916c84 (patch) | |
tree | a0d9ac76ddb08db9e224272e60a41f26d27d2257 /python/fatcat_tools | |
parent | 963faf6cf6e7e5c6685ffe89e080134c7590957f (diff) | |
parent | bbe37c06a3d6c213823258f054d10eaf0814da8f (diff) | |
download | fatcat-e749b576bdb9bbec3bcef7e4e389e7fbbf916c84.tar.gz fatcat-e749b576bdb9bbec3bcef7e4e389e7fbbf916c84.zip |
Merge branch 'bnewbold-py37-cleanups' into 'master'
py37 cleanups
See merge request webgroup/fatcat!44
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r-- | python/fatcat_tools/importers/common.py | 2 | ||||
-rw-r--r-- | python/fatcat_tools/normal.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py index da611ecb..99c330a6 100644 --- a/python/fatcat_tools/importers/common.py +++ b/python/fatcat_tools/importers/common.py @@ -306,7 +306,7 @@ class EntityImporter: self._issnl_id_map = dict() self._orcid_id_map = dict() - self._orcid_regex = re.compile("^\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]$") + self._orcid_regex = re.compile(r"^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$") self._doi_id_map = dict() self._pmid_id_map = dict() diff --git a/python/fatcat_tools/normal.py b/python/fatcat_tools/normal.py index 7a2b5fd9..528a822e 100644 --- a/python/fatcat_tools/normal.py +++ b/python/fatcat_tools/normal.py @@ -6,7 +6,7 @@ free-form input, titles, etc. import re -DOI_REGEX = re.compile("^10.\d{3,6}/\S+$") +DOI_REGEX = re.compile(r"^10.\d{3,6}/\S+$") def clean_doi(raw): """ @@ -66,7 +66,7 @@ def test_clean_doi(): assert clean_doi("doi:10.1234/ asdf ") == None assert clean_doi("10.4149/gpb¬_2017042") == None # "logical negation" character -ARXIV_ID_REGEX = re.compile("^(\d{4}.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?/\d{7})(v\d+)?$") +ARXIV_ID_REGEX = re.compile(r"^(\d{4}.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?/\d{7})(v\d+)?$") def clean_arxiv_id(raw): """ @@ -175,7 +175,7 @@ def test_clean_sha256(): assert clean_sha256("6cc853f2ae75696b2e45f476c76b946b0fc2df7c52bb38287cb074aceb77bc7f") == "6cc853f2ae75696b2e45f476c76b946b0fc2df7c52bb38287cb074aceb77bc7f" assert clean_sha256("0fba3fba0e1937aa0297de3836b768b5dfb23d7b") == None -ISSN_REGEX = re.compile("^\d{4}-\d{3}[0-9X]$") +ISSN_REGEX = re.compile(r"^\d{4}-\d{3}[0-9X]$") def clean_issn(raw): if not raw: @@ -193,7 +193,7 @@ def test_clean_issn(): assert clean_issn("134-4567") == None assert clean_issn("123X-4567") == None -ISBN13_REGEX = re.compile("^97(?:8|9)-\d{1,5}-\d{1,7}-\d{1,6}-\d$") +ISBN13_REGEX = re.compile(r"^97(?:8|9)-\d{1,5}-\d{1,7}-\d{1,6}-\d$") def clean_isbn13(raw): if not raw: @@ -209,7 +209,7 @@ def test_clean_isbn13(): assert clean_isbn13("978-1-56619-909-4 ") == "978-1-56619-909-4" assert clean_isbn13("9781566199094") == None -ORCID_REGEX = re.compile("^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$") +ORCID_REGEX = re.compile(r"^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$") def clean_orcid(raw): if not raw: |