diff options
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-x | python/fatcat_import.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/fatcat_import.py b/python/fatcat_import.py index 252ab3a5..498683e0 100755 --- a/python/fatcat_import.py +++ b/python/fatcat_import.py @@ -236,6 +236,11 @@ def run_datacite(args): else: JsonLinePusher(dci, args.json_file).run() +def run_file_meta(args): + fmi = FileMetaImporter(args.api, + edit_batch_size=100) + JsonLinePusher(fmi, args.json_file).run() + def main(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -556,6 +561,16 @@ def main(): auth_var="FATCAT_AUTH_WORKER_DATACITE", ) + sub_file_meta = subparsers.add_parser('file-meta', + help="simple update-only importer for file metadata") + sub_file_meta.set_defaults( + func=run_file_meta, + auth_var="FATCAT_API_AUTH_TOKEN", + ) + sub_file_meta.add_argument('json_file', + help="File with jsonlines from file_meta schema to import from", + default=sys.stdin, type=argparse.FileType('r')) + args = parser.parse_args() if not args.__dict__.get("func"): print("tell me what to do!") |