aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_import.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-xpython/fatcat_import.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/fatcat_import.py b/python/fatcat_import.py
index 252ab3a5..e92b3106 100755
--- a/python/fatcat_import.py
+++ b/python/fatcat_import.py
@@ -236,6 +236,14 @@ def run_datacite(args):
else:
JsonLinePusher(dci, args.json_file).run()
+def run_file_meta(args):
+ # do_updates defaults to true for this importer
+ fmi = FileMetaImporter(args.api,
+ edit_batch_size=100,
+ editgroup_description=args.editgroup_description_override,
+ )
+ JsonLinePusher(fmi, args.json_file).run()
+
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
@@ -556,6 +564,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!")