-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparse_arguments.py
47 lines (38 loc) · 1.26 KB
/
parse_arguments.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
40
41
42
43
44
45
46
47
""" reads command-line arguments """
import argparse
import logging
import default
def parse_arguments(args):
""" reads command-line arguments """
edu_parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
edu_parser.add_argument(
"-f", "--file",
help="File containing the responses",
type=str, required=False, default=default.DEFAULT_FILE
)
edu_parser.add_argument(
"-c", "--confidential",
help="Ignores student emails in responses",
action="store_true", required=False
)
edu_parser.add_argument(
"-t", "--topics",
help="Sets number of topics for LDA analysis",
type=int, required=False, default=default.DEFAULT_NUM_OF_TOPICS
)
edu_parser.add_argument(
"-g",
"--graph",
help="Displays trend over time, average scores for each response," +
" and box plot for each entry",
action="store_true",
required=False)
edu_parser.add_argument(
"-d", "--debug",
help="Display diagnostic information",
action="store_const", dest="logging_level",
const=logging.DEBUG, default=logging.ERROR
)
arguments = edu_parser.parse_args(args)
return arguments