From 9792a49572e98ac686bd42d307206fac1d723e20 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 19 Nov 2018 13:48:24 -0800 Subject: example shell interface for fatcat python lib --- python/shell.py | 40 ++++++++++++++++++++++++++++++++++++++++ python/shell.sh | 6 ++++++ 2 files changed, 46 insertions(+) create mode 100644 python/shell.py create mode 100755 python/shell.sh 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 -- cgit v1.2.3