-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (34 loc) · 1.21 KB
/
main.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
48
from utils import scrape_contractors, tprint
import sys
import gpandas as gpd
GSHEET = '1PRYYRoSDazS_aMZ2He_2Okto73QKP4BEl4JwIX2O5dQ'
def main():
ruts_pending = 1
while ruts_pending != 0:
try:
PLANILLA = gpd.gExcelFile(GSHEET)
CONTRATISTAS = PLANILLA.parse('Lista Contratistas')
df = CONTRATISTAS.copy()
try:
ruts_all = set(df.Rut)
except:
ruts_all = set(df['RUT / Nro.Cliente'])
sets = []
for sheet in [s for s in PLANILLA.sheet_names if s in ['Curriculum Empresarial', 'Evaluación Comportamiento']]:
try:
sets.append(set(PLANILLA.parse(sheet)['1. Rut'].tolist()))
except:
sets.append(set())
ruts_done = set.intersection(*sets)
ruts_pending = ruts_all - ruts_done
scrape_contractors(ruts_pending)
except KeyboardInterrupt:
print()
tprint('Keyboard Interrupt')
input()
sys.exit()
print()
tprint('[+] DONE')
sys.exit()
if __name__ == "__main__":
main()