aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-12-21 20:02:54 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-12-21 20:02:54 +0100
commita6e4a6cca4e9583031333247200f3c105f02b1f0 (patch)
treec9d6b0f510b2b72af016733a68baef2f945ac50b
parent754b2419fc09bee03e0dc2f9e14479890bdb5a64 (diff)
downloadfuzzycat-a6e4a6cca4e9583031333247200f3c105f02b1f0.tar.gz
fuzzycat-a6e4a6cca4e9583031333247200f3c105f02b1f0.zip
matching: fix import
-rw-r--r--fuzzycat/matching.py1
-rw-r--r--fuzzycat/verify.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/fuzzycat/matching.py b/fuzzycat/matching.py
index 0a096d6..13634e0 100644
--- a/fuzzycat/matching.py
+++ b/fuzzycat/matching.py
@@ -8,6 +8,7 @@ import elasticsearch_dsl
import fatcat_openapi_client
import requests
from fatcat_openapi_client import ContainerEntity, DefaultApi, ReleaseEntity
+from fatcat_openapi_client.rest import ApiException
from fuzzycat.entities import entity_from_dict, entity_from_json
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index f6c96f3..99b507a 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -83,15 +83,15 @@ import re
import sys
from typing import Counter, Dict, Tuple, Type
+from fatcat_openapi_client import ReleaseEntity
from glom import PathAccessError, glom
from fuzzycat.common import Reason, Status
from fuzzycat.data import (CONTAINER_NAME_BLACKLIST, PUBLISHER_BLACKLIST, TITLE_BLACKLIST,
TITLE_FRAGMENT_BLACKLIST)
+from fuzzycat.entities import entity_to_dict
from fuzzycat.utils import (author_similarity_score, contains_chemical_formula, dict_key_exists,
has_doi_prefix, jaccard, num_project, parse_page_string, slugify_string)
-from fuzzycat.entities import entity_to_dict
-from fatcat_openapi_client import ReleaseEntity
Verify = collections.namedtuple("Verify", "status reason")
@@ -149,6 +149,7 @@ class GroupVerifier:
def verify_release_entities(a: ReleaseEntity, b: ReleaseEntity, min_title_length=5) -> Type[Verify]:
return verify(entity_to_dict(a), entity_to_dict(b), min_title_length=min_title_length)
+
def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]:
"""
Compare two entities (dicts), return tuple of match status and reason.