aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-11-19 13:48:24 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-11-19 13:48:24 -0800
commit9792a49572e98ac686bd42d307206fac1d723e20 (patch)
tree3ff2e5bfef9e6d5c77fe012291a0c7bcf1a30880
parentf47260eff9e5905e412d33126607fbe0eadcde68 (diff)
downloadfatcat-9792a49572e98ac686bd42d307206fac1d723e20.tar.gz
fatcat-9792a49572e98ac686bd42d307206fac1d723e20.zip
example shell interface for fatcat python lib
-rw-r--r--python/shell.py40
-rwxr-xr-xpython/shell.sh6
2 files changed, 46 insertions, 0 deletions
diff --git a/python/shell.py b/python/shell.py
new file mode 100644
index 00000000..7b795b4e
--- /dev/null
+++ b/python/shell.py
@@ -0,0 +1,40 @@
+
+# bunch of libraries one might want
+import uuid
+import datetime
+import requests
+import argparse
+
+import fatcat_client
+from fatcat_client import *
+from fatcat_tools import *
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--debug',
+ action='store_true',
+ help="enable debugging interface")
+
+ args = parser.parse_args()
+
+ #api =
+ print(" __ _ _ _ ")
+ print(" / _| __ _| |_ ___ __ _| |_| |")
+ print("| |_ / _` | __/ __/ _` | __| |")
+ print("| _| (_| | || (_| (_| | |_|_|")
+ print("|_| \__,_|\__\___\__,_|\__(_)")
+ print()
+
+ admin_id = "aaaaaaaaaaaabkvkaaaaaaaaae"
+
+ local_conf = fatcat_client.Configuration()
+ local_conf.host = 'http://localhost:9411/v0'
+ local_api = fatcat_client.DefaultApi(fatcat_client.ApiClient(local_conf))
+
+ prod_conf = fatcat_client.Configuration()
+ prod_conf.host = 'https://api.fatcat.wiki/v0'
+ prod_api = fatcat_client.DefaultApi(fatcat_client.ApiClient(prod_conf))
+
+ qa_conf = fatcat_client.Configuration()
+ qa_conf.host = 'https://api.qa.fatcat.wiki/v0'
+ qa_api = fatcat_client.DefaultApi(fatcat_client.ApiClient(qa_conf))
diff --git a/python/shell.sh b/python/shell.sh
new file mode 100755
index 00000000..31cf767f
--- /dev/null
+++ b/python/shell.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+# Run this file like:
+# pipenv run ./shell.sh
+
+ipython3 -i --no-banner --nosep --pprint shell.py