summaryrefslogtreecommitdiffstats
path: root/python/client.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-21 10:19:50 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-21 10:19:50 -0700
commitf7c04ce03335c24da4cfe44a1bcbc1f8ea14784c (patch)
tree4a40303efab7fd01109adcb3e6ac3440c9f1b4fe /python/client.py
parenta1d94e6c28b080158fd65d0ec54ff6d64451df97 (diff)
downloadfatcat-f7c04ce03335c24da4cfe44a1bcbc1f8ea14784c.tar.gz
fatcat-f7c04ce03335c24da4cfe44a1bcbc1f8ea14784c.zip
ISSN importer
Diffstat (limited to 'python/client.py')
-rwxr-xr-xpython/client.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/client.py b/python/client.py
index ca6af603..4f6d3ccc 100755
--- a/python/client.py
+++ b/python/client.py
@@ -18,6 +18,10 @@ def run_import_orcid(args):
foi = FatcatOrcidImporter(args.host_url)
foi.process_batch(args.json_file, size=args.batch_size)
+def run_import_issn(args):
+ fii = FatcatIssnImporter(args.host_url)
+ fii.process_batch(args.csv_file, size=args.batch_size)
+
def run_import_manifest(args):
fmi = FatcatManifestImporter(args.host_url)
fmi.process_db(args.db_path, size=args.batch_size)
@@ -55,6 +59,15 @@ def main():
help="size of batch to send",
default=50, type=int)
+ sub_import_issn = subparsers.add_parser('import-issn')
+ sub_import_issn.set_defaults(func=run_import_issn)
+ sub_import_issn.add_argument('csv_file',
+ help="Journal ISSN CSV metadata file to import from (or stdin)",
+ default=sys.stdin, type=argparse.FileType('r'))
+ sub_import_issn.add_argument('--batch-size',
+ help="size of batch to send",
+ default=50, type=int)
+
sub_import_manifest = subparsers.add_parser('import-manifest')
sub_import_manifest.set_defaults(func=run_import_manifest)
sub_import_manifest.add_argument('db_path',