summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-08-24 13:21:06 +0200
committerBryan Newbold <bnewbold@robocracy.org>2019-09-03 13:31:49 -0700
commitbea64958a70040a7fa44434d3a23078f9cf871a0 (patch)
tree13448aa6f92a1fe46d2d918cc8e7bf454778afc8 /python
parentc5c5c95fbd40e981ed4b287fc8d7f4d5a798088a (diff)
downloadfatcat-bea64958a70040a7fa44434d3a23078f9cf871a0.tar.gz
fatcat-bea64958a70040a7fa44434d3a23078f9cf871a0.zip
start chocula importer
Diffstat (limited to 'python')
-rwxr-xr-xpython/fatcat_import.py14
1 files changed, 14 insertions, 0 deletions
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,