-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
32 lines (25 loc) · 1.25 KB
/
cli.py
File metadata and controls
32 lines (25 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import argparse
from cacheback2 import cache_back
from cacheback2 import headers
def main(params):
user = params.user
password = params.password
host = params.host
port = params.port
db = params.db
notebook_path = params.notebook
file_name = headers.get_notebook_name(notebook_path)
cache_back.init_session(db_name=db, db_user=user, db_pass=password, db_host=host, db_port=port, notebook_name=notebook_path)
cache_back.send_blob(notebook_path, file_name)
cache_back.rewrite_pipeline()
cache_back.return_new_notebook(notebook_path)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='CacheBack is a tool to cache preprocessing steps for faster analytics.')
parser.add_argument('--user', required=True, help='user name for postgres')
parser.add_argument('--password', required=True, help='password for postgres')
parser.add_argument('--host', required=True, help='host for postgres')
parser.add_argument('--port', required=True, help='port for postgres')
parser.add_argument('--db', required=True, help='database name for postgres')
parser.add_argument('--notebook', required=True, help='Notebook path to be pushed on to postgres')
args = parser.parse_args()
main(args)