diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-06-20 09:37:37 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-06-20 09:37:37 -0700 |
commit | bde5c8f14e13afe4d54e9bfafd8bda8b0f33f804 (patch) | |
tree | 67d7039b1621bebdafd89539602c2b5d05332501 /python/client.py | |
parent | 698399c49edcefe33c012856b604985925969a77 (diff) | |
download | fatcat-bde5c8f14e13afe4d54e9bfafd8bda8b0f33f804.tar.gz fatcat-bde5c8f14e13afe4d54e9bfafd8bda8b0f33f804.zip |
python: refactor importer code (+crossref)
Diffstat (limited to 'python/client.py')
-rwxr-xr-x | python/client.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/python/client.py b/python/client.py index 14814512..9631318a 100755 --- a/python/client.py +++ b/python/client.py @@ -2,21 +2,21 @@ import sys import argparse -from fatcat.api_client import FatCatApiClient +from fatcat.raw_api_client import RawFatcatApiClient from fatcat.orcid_importer import FatcatOrcidImporter def run_import_crossref(args): - fcc = FatCatApiClient(args.host_url) - fcc.import_crossref_file(args.json_file, - create_containers=args.create_containers) + fcc = FatcatCrossrefClient(args.host_url) + fcc.import_crossref_file(args.json_file) + # create_containers=args.create_containers def run_import_orcid(args): foi = FatcatOrcidImporter(args.host_url) foi.process_batch(args.json_file, size=args.batch_size) def health(args): - fcc = FatCatApiClient(args.host_url) - print(fcc.health()) + rfac = RawFatcatApiClient(args.host_url) + print(rfac.health()) def main(): parser = argparse.ArgumentParser() @@ -32,9 +32,10 @@ def main(): sub_import_crossref.set_defaults(func=run_import_crossref) sub_import_crossref.add_argument('json_file', help="crossref JSON file to import from") - sub_import_crossref.add_argument('--create-containers', - action='store_true', - help="if true, create containers based on ISSN") + # TODO: + #sub_import_crossref.add_argument('--create-containers', + # action='store_true', + # help="if true, create containers based on ISSN") sub_import_orcid = subparsers.add_parser('import-orcid') sub_import_orcid.set_defaults(func=run_import_orcid) |