-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_ingest.py
31 lines (25 loc) · 873 Bytes
/
run_ingest.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
from ingest.ultrasignup import UltrasignupIngest
from ingest.ahotu import AhotuIngest
from client import connect
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
ultrasignup = True
ahotu = True
max_batches = 4
client = connect()
if ultrasignup:
uti = UltrasignupIngest()
uti_requests = uti.fetch()
for i, batch in enumerate(uti_requests):
parsed_batch = uti.parse(batch.fetch())
uti.upload(parsed_batch, client=client)
if i >= max_batches:
break
if ahotu:
ahi = AhotuIngest()
ahotu_requests = ahi.fetch()
for i, batch in enumerate(ahotu_requests):
parsed_batch = ahi.parse(batch.fetch())
ahi.upload(parsed_batch, client=client)
if i >= max_batches:
break