diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 14:28:57 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 17:02:49 -0700 |
commit | a0d89d08b40c07b13a76a8afd020b0d1e62e58aa (patch) | |
tree | e44c6fce15cda3359d82e0cd991a79ebf70cfb02 /python/fatcat_tools | |
parent | 8e2fd41d10725b65c787ae56cb9320fbcc182288 (diff) | |
download | fatcat-a0d89d08b40c07b13a76a8afd020b0d1e62e58aa.tar.gz fatcat-a0d89d08b40c07b13a76a8afd020b0d1e62e58aa.zip |
small python tweaks for annotations, imports
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r-- | python/fatcat_tools/importers/common.py | 2 | ||||
-rw-r--r-- | python/fatcat_tools/importers/crossref.py | 6 | ||||
-rw-r--r-- | python/fatcat_tools/transforms/elasticsearch.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py index 2c4dd496..9d22ce83 100644 --- a/python/fatcat_tools/importers/common.py +++ b/python/fatcat_tools/importers/common.py @@ -7,7 +7,7 @@ import sqlite3 import datetime import subprocess from collections import Counter -from typing import Dict, Any, List, Optional +from typing import Dict, Any, List, Optional, Tuple import lxml import xml.etree.ElementTree as ET diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py index d4b4a4c7..bd72a781 100644 --- a/python/fatcat_tools/importers/crossref.py +++ b/python/fatcat_tools/importers/crossref.py @@ -1,7 +1,11 @@ import sqlite3 import datetime +from typing import Dict, Optional, Any + import fatcat_openapi_client +from fatcat_openapi_client import ReleaseEntity + from .common import EntityImporter, clean @@ -452,7 +456,7 @@ class CrossrefImporter(EntityImporter): if not extra: extra = None - re = fatcat_openapi_client.ReleaseEntity( + re = ReleaseEntity( work_id=None, container_id=container_id, title=title, diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py index 26eacded..bfc18f83 100644 --- a/python/fatcat_tools/transforms/elasticsearch.py +++ b/python/fatcat_tools/transforms/elasticsearch.py @@ -4,7 +4,7 @@ from typing import Dict, List, Any, Optional import tldextract -from fatcat_openapi_client import ReleaseEntity, ContainerEntity +from fatcat_openapi_client import ReleaseEntity, ContainerEntity, EntityEdit, ChangelogEntry, FileEntity def check_kbart(year: int, archive: dict) -> Optional[bool]: |