-
Notifications
You must be signed in to change notification settings - Fork 0
/
report_client.py
executable file
·32 lines (23 loc) · 985 Bytes
/
report_client.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from class_toggl import TogglClient
import argparse
# togg = TogglClient()
# togg.report_by_client('Bieler', 'LastMonth')
if __name__ == '__main__':
# clientes = ['Bieler', 'Colombero']
# tags = ['no-remunerable', 'remunerable']
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-c', '--client', dest='client', type=str, help='Intrese un cliente')
parser.add_argument('-d', '--daterange', dest='date_range', type=str,
choices=['Today', 'Yesterday', 'ThisWeek', 'LastWeek', 'ThisMonth', 'LastMonth', 'Q1', 'Q2', 'Q3', 'Q4'],
default='LastMonth', help='Selecione un rango de fecha')
args = parser.parse_args()
togg = TogglClient()
if args.client is None:
print("Lista de clientes")
for t in togg.list_clients():
print(t['name'])
else:
togg.report_by_client(args.client, args.date_range)