summaryrefslogtreecommitdiffstats
path: root/python/fatcat_import.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-12-23 17:59:10 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-02-13 22:24:20 -0800
commite59d1b617d4abd5f002d9e59b6bbaebc9ff30993 (patch)
tree902846f104b5679d92a85f2b6e305e6397410265 /python/fatcat_import.py
parent07fabec32aada55a75c064e5c1e01a46da30d854 (diff)
downloadfatcat-e59d1b617d4abd5f002d9e59b6bbaebc9ff30993.tar.gz
fatcat-e59d1b617d4abd5f002d9e59b6bbaebc9ff30993.zip
basic shadow importer
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-xpython/fatcat_import.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/fatcat_import.py b/python/fatcat_import.py
index ad4de0e2..1f026edc 100755
--- a/python/fatcat_import.py
+++ b/python/fatcat_import.py
@@ -166,6 +166,11 @@ def run_grobid_metadata(args):
bezerk_mode=args.bezerk_mode)
LinePusher(fmi, args.tsv_file).run()
+def run_shadow_lib(args):
+ fmi = ShadowLibraryImporter(args.api,
+ edit_batch_size=100)
+ JsonLinePusher(fmi, args.json_file).run()
+
def run_wayback_static(args):
api = args.api
@@ -473,6 +478,16 @@ def main():
action='store_true',
help="don't lookup existing files, just insert (clobbers; only for fast bootstrap)")
+ sub_shadow_lib = subparsers.add_parser('shadow-lib',
+ help="create release and file entities based on GROBID PDF metadata extraction")
+ sub_shadow_lib.set_defaults(
+ func=run_shadow_lib,
+ auth_var="FATCAT_API_AUTH_TOKEN",
+ )
+ sub_shadow_lib.add_argument('json_file',
+ help="JSON file to import from (or stdin)",
+ default=sys.stdin, type=argparse.FileType('r'))
+
sub_wayback_static = subparsers.add_parser('wayback-static',
help="crude crawl+ingest tool for single-page HTML docs from wayback")
sub_wayback_static.set_defaults(