-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathanalyzer.py
39 lines (27 loc) · 900 Bytes
/
analyzer.py
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
38
39
import argparse
import sys
import colorama
from src.metrics import Metrics
VERSION = "0.0.1"
def init_args():
"""Parse and return the arguments."""
parser = argparse.ArgumentParser(description="Simple Gmail Analyzer")
parser.add_argument("--top", type=int, default=10, help="Number of results to show")
parser.add_argument(
"--user", type=str, default="me", help="User ID to fetch data for"
)
parser.add_argument(
"--verbose", action="store_true", help="Verbose output, helpful for debugging"
)
parser.add_argument(
"--version", action="store_true", help="Display version and exit"
)
args = vars(parser.parse_args())
return args
if __name__ == "__main__":
colorama.init()
args = init_args()
if args["version"]:
print("gmail analyzer v{}".format(VERSION))
sys.exit()
Metrics(args).start()