aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_client.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-28 13:04:46 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-28 13:04:46 -0700
commitaf542d66d884bd17daa6f40f3556aa4189b23b36 (patch)
tree8b9ab8b62da97f547dea7caf8be3d52917e884de /python/fatcat_client.py
parent6918fced32c7cb8c351692b0fd5e87dd3ed734a2 (diff)
downloadfatcat-af542d66d884bd17daa6f40f3556aa4189b23b36.tar.gz
fatcat-af542d66d884bd17daa6f40f3556aa4189b23b36.zip
python client codegen
Diffstat (limited to 'python/fatcat_client.py')
-rwxr-xr-xpython/fatcat_client.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/python/fatcat_client.py b/python/fatcat_client.py
deleted file mode 100755
index d1580be5..00000000
--- a/python/fatcat_client.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python3
-
-import argparse
-from fatcat.api_client import FatCatApiClient
-
-def import_crossref(args):
- fcc = FatCatApiClient(args.host_url)
- fcc.import_crossref_file(args.json_file,
- create_containers=args.create_containers)
-
-def health(args):
- fcc = FatCatApiClient(args.host_url)
- print(fcc.health())
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument('--debug',
- action='store_true',
- help="enable debugging interface")
- parser.add_argument('--host-url',
- default="http://localhost:8040",
- help="connect to this host/port")
- subparsers = parser.add_subparsers()
-
- sub_import_crossref = subparsers.add_parser('import-crossref',
- aliases=['ic'])
- sub_import_crossref.set_defaults(func=import_crossref)
- sub_import_crossref.add_argument('json_file',
- help="crossref JSON file to import from")
- sub_import_crossref.add_argument('--create-containers',
- action='store_true',
- help="if true, create containers based on ISSN")
-
- sub_health = subparsers.add_parser('health')
- sub_health.set_defaults(func=health)
-
- args = parser.parse_args()
- args.func(args)
-
-if __name__ == '__main__':
- main()