summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-12 23:37:28 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-12 23:37:28 -0800
commit7ebda2e051b51e49544ab75673b19ec5f27d9d45 (patch)
tree671fd995b2fdb0b9ec69cfcb0e7771f43c13d32d /python
parent889606ffac5096610e6123134cb89423c15ef464 (diff)
downloadfatcat-7ebda2e051b51e49544ab75673b19ec5f27d9d45.tar.gz
fatcat-7ebda2e051b51e49544ab75673b19ec5f27d9d45.zip
more python module refactoring
Diffstat (limited to 'python')
-rwxr-xr-xpython/fatcat_export.py2
-rwxr-xr-xpython/fatcat_import.py10
-rw-r--r--python/fatcat_tools/changelog_workers.py2
-rw-r--r--python/fatcat_tools/crossref_importer.py2
-rw-r--r--python/fatcat_tools/elastic_workers.py4
-rwxr-xr-xpython/fatcat_tools/grobid_metadata_importer.py2
-rw-r--r--python/fatcat_tools/issn_importer.py2
-rw-r--r--python/fatcat_tools/matched_importer.py2
-rw-r--r--python/fatcat_tools/orcid_importer.py2
-rw-r--r--python/fatcat_tools/transforms.py (renamed from python/fatcat_tools/entity_helpers.py)0
-rwxr-xr-xpython/fatcat_worker.py4
-rw-r--r--python/tests/crossref.py2
-rw-r--r--python/tests/fixtures.py8
-rw-r--r--python/tests/grobid_metadata_importer_test.py (renamed from python/tests/grobid_metadata_importer.py)2
-rw-r--r--python/tests/importer.py2
-rw-r--r--python/tests/issn.py2
-rw-r--r--python/tests/matched_importer_test.py (renamed from python/tests/matched_importer.py)2
-rw-r--r--python/tests/orcid.py2
-rw-r--r--python/tests/routes.py1
-rw-r--r--python/tests/transform_tests.py (renamed from python/tests/entity_helpers.py)4
20 files changed, 28 insertions, 29 deletions
diff --git a/python/fatcat_export.py b/python/fatcat_export.py
index 6c4502af..eadf69ab 100755
--- a/python/fatcat_export.py
+++ b/python/fatcat_export.py
@@ -5,7 +5,7 @@ import json
import argparse
import fatcat_client
from fatcat_client.rest import ApiException
-from fatcat.fcid import uuid2fcid
+from fatcat_tools.fcid import uuid2fcid
def run_export_releases(args):
conf = fatcat_client.Configuration()
diff --git a/python/fatcat_import.py b/python/fatcat_import.py
index c5610344..6c66d98a 100755
--- a/python/fatcat_import.py
+++ b/python/fatcat_import.py
@@ -2,11 +2,11 @@
import sys
import argparse
-from fatcat.crossref_importer import FatcatCrossrefImporter
-from fatcat.orcid_importer import FatcatOrcidImporter
-from fatcat.issn_importer import FatcatIssnImporter
-from fatcat.matched_importer import FatcatMatchedImporter
-from fatcat.grobid_metadata_importer import FatcatGrobidMetadataImporter
+from fatcat_tools.crossref_importer import FatcatCrossrefImporter
+from fatcat_tools.orcid_importer import FatcatOrcidImporter
+from fatcat_tools.issn_importer import FatcatIssnImporter
+from fatcat_tools.matched_importer import FatcatMatchedImporter
+from fatcat_tools.grobid_metadata_importer import FatcatGrobidMetadataImporter
def run_import_crossref(args):
fci = FatcatCrossrefImporter(args.host_url, args.issn_map_file,
diff --git a/python/fatcat_tools/changelog_workers.py b/python/fatcat_tools/changelog_workers.py
index e341ea32..223d4478 100644
--- a/python/fatcat_tools/changelog_workers.py
+++ b/python/fatcat_tools/changelog_workers.py
@@ -2,7 +2,7 @@
import json
import time
from itertools import islice
-from fatcat.worker_common import FatcatWorker
+from fatcat_tools.worker_common import FatcatWorker
from pykafka.common import OffsetType
diff --git a/python/fatcat_tools/crossref_importer.py b/python/fatcat_tools/crossref_importer.py
index 37005965..6a5ad824 100644
--- a/python/fatcat_tools/crossref_importer.py
+++ b/python/fatcat_tools/crossref_importer.py
@@ -5,7 +5,7 @@ import sqlite3
import datetime
import itertools
import fatcat_client
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
class FatcatCrossrefImporter(FatcatImporter):
diff --git a/python/fatcat_tools/elastic_workers.py b/python/fatcat_tools/elastic_workers.py
index 3d2e9c39..eac8d6b0 100644
--- a/python/fatcat_tools/elastic_workers.py
+++ b/python/fatcat_tools/elastic_workers.py
@@ -2,9 +2,9 @@
import json
import time
import requests
-from fatcat.worker_common import FatcatWorker
+from fatcat_tools.worker_common import FatcatWorker
from fatcat_client.models import ReleaseEntity
-from fatcat.entity_helpers import *
+from fatcat_tools.transforms import *
from pykafka.common import OffsetType
diff --git a/python/fatcat_tools/grobid_metadata_importer.py b/python/fatcat_tools/grobid_metadata_importer.py
index 95cc285e..effa0d94 100755
--- a/python/fatcat_tools/grobid_metadata_importer.py
+++ b/python/fatcat_tools/grobid_metadata_importer.py
@@ -5,7 +5,7 @@ import json
import base64
import datetime
import fatcat_client
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
MAX_ABSTRACT_BYTES=4096
diff --git a/python/fatcat_tools/issn_importer.py b/python/fatcat_tools/issn_importer.py
index c9ef50b5..e3ed7382 100644
--- a/python/fatcat_tools/issn_importer.py
+++ b/python/fatcat_tools/issn_importer.py
@@ -3,7 +3,7 @@ import sys
import json
import itertools
import fatcat_client
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
# CSV format (generated from git.archive.org/webgroup/oa-journal-analysis):
# ISSN-L,in_doaj,in_road,in_norwegian,in_crossref,title,publisher,url,lang,ISSN-print,ISSN-electronic,doi_count,has_doi,is_oa,is_kept,publisher_size,url_live,url_live_status,url_live_final_status,url_live_final_url,url_live_status_simple,url_live_final_status_simple,url_domain,gwb_pdf_count
diff --git a/python/fatcat_tools/matched_importer.py b/python/fatcat_tools/matched_importer.py
index 7f55369b..627ab6f1 100644
--- a/python/fatcat_tools/matched_importer.py
+++ b/python/fatcat_tools/matched_importer.py
@@ -4,7 +4,7 @@ import json
import sqlite3
import itertools
import fatcat_client
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
#row = row.split('\t')
#assert len(row) == 2
diff --git a/python/fatcat_tools/orcid_importer.py b/python/fatcat_tools/orcid_importer.py
index e1f5943c..f2366c66 100644
--- a/python/fatcat_tools/orcid_importer.py
+++ b/python/fatcat_tools/orcid_importer.py
@@ -3,7 +3,7 @@ import sys
import json
import itertools
import fatcat_client
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
def value_or_none(e):
if type(e) == dict:
diff --git a/python/fatcat_tools/entity_helpers.py b/python/fatcat_tools/transforms.py
index c454536b..c454536b 100644
--- a/python/fatcat_tools/entity_helpers.py
+++ b/python/fatcat_tools/transforms.py
diff --git a/python/fatcat_worker.py b/python/fatcat_worker.py
index 50ff0fb7..5d3731f6 100755
--- a/python/fatcat_worker.py
+++ b/python/fatcat_worker.py
@@ -2,8 +2,8 @@
import sys
import argparse
-from fatcat.changelog_workers import FatcatChangelogWorker, FatcatEntityUpdatesWorker
-from fatcat.elastic_workers import FatcatElasticReleaseWorker
+from fatcat_tools.changelog_workers import FatcatChangelogWorker, FatcatEntityUpdatesWorker
+from fatcat_tools.elastic_workers import FatcatElasticReleaseWorker
def run_changelog_worker(args):
topic = "fatcat-{}.changelog".format(args.env)
diff --git a/python/tests/crossref.py b/python/tests/crossref.py
index 59be9886..04ac5e8e 100644
--- a/python/tests/crossref.py
+++ b/python/tests/crossref.py
@@ -1,7 +1,7 @@
import json
import pytest
-from fatcat.crossref_importer import FatcatCrossrefImporter
+from fatcat_tools.crossref_importer import FatcatCrossrefImporter
@pytest.fixture(scope="function")
diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py
index 6ff05495..6f68cf5c 100644
--- a/python/tests/fixtures.py
+++ b/python/tests/fixtures.py
@@ -4,14 +4,14 @@ import time
import json
import signal
import pytest
-import fatcat
+import fatcat_web
@pytest.fixture
def full_app():
- fatcat.app.testing = True
- fatcat.app.debug = False
- return fatcat.app
+ fatcat_web.app.testing = True
+ fatcat_web.app.debug = False
+ return fatcat_web.app
@pytest.fixture
def app(full_app):
diff --git a/python/tests/grobid_metadata_importer.py b/python/tests/grobid_metadata_importer_test.py
index 2c8565aa..502ca74a 100644
--- a/python/tests/grobid_metadata_importer.py
+++ b/python/tests/grobid_metadata_importer_test.py
@@ -3,7 +3,7 @@ import os
import json
import base64
import pytest
-from fatcat.grobid_metadata_importer import FatcatGrobidMetadataImporter
+from fatcat_tools.grobid_metadata_importer import FatcatGrobidMetadataImporter
"""
WARNING: these tests are currently very fragile because they have database
diff --git a/python/tests/importer.py b/python/tests/importer.py
index 22af37ed..0de86635 100644
--- a/python/tests/importer.py
+++ b/python/tests/importer.py
@@ -1,7 +1,7 @@
import pytest
-from fatcat.importer_common import FatcatImporter
+from fatcat_tools.importer_common import FatcatImporter
def test_issnl_mapping_lookup():
diff --git a/python/tests/issn.py b/python/tests/issn.py
index fff112f7..76c8aecb 100644
--- a/python/tests/issn.py
+++ b/python/tests/issn.py
@@ -1,6 +1,6 @@
import pytest
-from fatcat.issn_importer import FatcatIssnImporter
+from fatcat_tools.issn_importer import FatcatIssnImporter
@pytest.fixture(scope="function")
diff --git a/python/tests/matched_importer.py b/python/tests/matched_importer_test.py
index 9cc6aa32..4042eabb 100644
--- a/python/tests/matched_importer.py
+++ b/python/tests/matched_importer_test.py
@@ -1,7 +1,7 @@
import json
import pytest
-from fatcat.matched_importer import FatcatMatchedImporter
+from fatcat_tools.matched_importer import FatcatMatchedImporter
@pytest.fixture(scope="function")
diff --git a/python/tests/orcid.py b/python/tests/orcid.py
index ae3d0d0b..f8228cc0 100644
--- a/python/tests/orcid.py
+++ b/python/tests/orcid.py
@@ -1,7 +1,7 @@
import json
import pytest
-from fatcat.orcid_importer import FatcatOrcidImporter
+from fatcat_tools.orcid_importer import FatcatOrcidImporter
@pytest.fixture(scope="function")
diff --git a/python/tests/routes.py b/python/tests/routes.py
index 8607e7c0..2e208d22 100644
--- a/python/tests/routes.py
+++ b/python/tests/routes.py
@@ -2,7 +2,6 @@
import json
import tempfile
import pytest
-import fatcat
from fatcat_client.rest import ApiException
from fixtures import *
diff --git a/python/tests/entity_helpers.py b/python/tests/transform_tests.py
index dd6fa00a..669c2526 100644
--- a/python/tests/entity_helpers.py
+++ b/python/tests/transform_tests.py
@@ -1,8 +1,8 @@
import json
import pytest
-from fatcat.crossref_importer import FatcatCrossrefImporter
-from fatcat.entity_helpers import *
+from fatcat_tools.crossref_importer import FatcatCrossrefImporter
+from fatcat_tools.transforms import *
from crossref import crossref_importer