From bea64958a70040a7fa44434d3a23078f9cf871a0 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 24 Aug 2019 13:21:06 +0200 Subject: start chocula importer --- python/fatcat_import.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/fatcat_import.py b/python/fatcat_import.py index 8595d16b..facf7eb9 100755 --- a/python/fatcat_import.py +++ b/python/fatcat_import.py @@ -58,6 +58,11 @@ def run_journal_metadata(args): edit_batch_size=args.batch_size) JsonLinePusher(fii, args.json_file).run() +def run_chocula(args): + fii = ChoculaImporter(args.api, + edit_batch_size=args.batch_size) + JsonLinePusher(fii, args.json_file).run() + def run_matched(args): fmi = MatchedImporter(args.api, edit_batch_size=args.batch_size, @@ -254,6 +259,15 @@ def main(): help="Journal JSON metadata file to import from (or stdin)", default=sys.stdin, type=argparse.FileType('r')) + sub_chocula = subparsers.add_parser('chocula') + sub_chocula.set_defaults( + func=run_chocula, + auth_var="FATCAT_AUTH_WORKER_JOURNAL_METADATA", + ) + sub_chocula.add_argument('json_file', + help="chocula JSON entities file (or stdin)", + default=sys.stdin, type=argparse.FileType('r')) + sub_matched = subparsers.add_parser('matched') sub_matched.set_defaults( func=run_matched, -- cgit v1.2.3