10 self.parser.add_argument('--file', dest='file', type=str, help='CSV file with data to use as arguments.') |
10 self.parser.add_argument('--file', dest='file', type=str, help='CSV file with data to use as arguments.') |
11 self.parser.add_argument('--init', dest='init', type=str, help='Query which initialize database session (eg. temporary function).') |
11 self.parser.add_argument('--init', dest='init', type=str, help='Query which initialize database session (eg. temporary function).') |
12 self.parser.add_argument('--output', dest='output', type=str, help='File name for results.') |
12 self.parser.add_argument('--output', dest='output', type=str, help='File name for results.') |
13 self.parser.add_argument('--outputfunc', dest='outputfunc', type=str, help='Python function which will format results (format_row(args, rows)).') |
13 self.parser.add_argument('--outputfunc', dest='outputfunc', type=str, help='Python function which will format results (format_row(args, rows)).') |
14 self.parser.add_argument('--header', dest='header', action='store_true', help='First line of CSV is header with names for columns. These name can be used in query.') |
14 self.parser.add_argument('--header', dest='header', action='store_true', help='First line of CSV is header with names for columns. These name can be used in query.') |
15 self.init() |
|
16 |
15 |
17 def _split_line(self, line): |
16 def _split_line(self, line): |
18 return [x.strip() for x in line.split(',')] |
17 return [x.strip() for x in line.split(',')] |
19 |
18 |
20 def main(self): |
19 def main(self): |