aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_import.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-21 11:58:46 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-21 11:58:46 -0800
commit7ec413416acb2b3d7da0be32b78982316b9c696f (patch)
treecc0799316a0875d7aea6f1d9fddc03fb5e505410 /python/fatcat_import.py
parent008366697aba8046fd33ae1f3707972d87c9a342 (diff)
downloadfatcat-7ec413416acb2b3d7da0be32b78982316b9c696f.tar.gz
fatcat-7ec413416acb2b3d7da0be32b78982316b9c696f.zip
crossref importer checks for existing DOIs
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-xpython/fatcat_import.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/python/fatcat_import.py b/python/fatcat_import.py
index aad4ee57..fe5b24a6 100755
--- a/python/fatcat_import.py
+++ b/python/fatcat_import.py
@@ -8,7 +8,8 @@ from fatcat_tools.importers import CrossrefImporter, OrcidImporter, \
def run_crossref(args):
fci = CrossrefImporter(args.host_url, args.issn_map_file,
- args.extid_map_file, create_containers=(not args.no_create_containers))
+ args.extid_map_file, create_containers=(not args.no_create_containers),
+ check_existing=(not args.no_release_updates))
if args.kafka_mode:
consumer = make_kafka_consumer(
args.kafka_hosts, args.kafka_env, "api-crossref", "fatcat-import")
@@ -29,7 +30,7 @@ def run_issn(args):
def run_matched(args):
fmi = MatchedImporter(args.host_url,
- skip_file_update=args.no_file_update)
+ skip_file_updates=args.no_file_updates)
fmi.process_batch(args.json_file, size=args.batch_size)
fmi.describe_run()
@@ -74,6 +75,9 @@ def main():
sub_crossref.add_argument('--kafka-mode',
action='store_true',
help="consume from kafka topic (not stdin)")
+ sub_crossref.add_argument('--no-release-updates',
+ action='store_true',
+ help="don't lookup existing DOIs, just insert (only for bootstrap)")
sub_orcid = subparsers.add_parser('orcid')
sub_orcid.set_defaults(func=run_orcid)
@@ -98,7 +102,7 @@ def main():
sub_matched.add_argument('json_file',
help="JSON file to import from (or stdin)",
default=sys.stdin, type=argparse.FileType('r'))
- sub_matched.add_argument('--no-file-update',
+ sub_matched.add_argument('--no-file-updates',
action='store_true',
help="don't lookup existing files, just insert (only for bootstrap)")
sub_matched.add_argument('--batch-size',