-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_database.py
More file actions
37 lines (29 loc) · 1.02 KB
/
Copy pathupdate_database.py
File metadata and controls
37 lines (29 loc) · 1.02 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
33
34
35
36
37
from src.CoinMetrics import CoinMetrics
import time
import getopt
import query
import sys
def update_database(asset=None):
cm = CoinMetrics(asset=asset)
cm.update_database()
def usage():
print("usage: python update_database.py")
print("========================================================")
print("-h: print this message")
print("-a: asset name, abbreviation of the crypto currency")
print(" Bitcoin: btc")
print(" Etherium: eth")
print(" Etherium Classic: etc")
print(" Litecoin: ltc")
print(" Bitcoin Cash: bch")
print(" Desired asset should be separated by comma: btc,ltc,bch,eth,etc")
print("========================================================")
if __name__ == "__main__":
opts,args = getopt.getopt(sys.argv[1:], "a:h", ["help", "asset"])
asset= None
for opt, content in opts:
if opt in ["-a", "--asset"]:
asset = content.split(",")
elif opt in ["-h", "--help"]:
usage()
update_database(asset=asset)