-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
53 lines (43 loc) · 1.33 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
49
50
51
52
53
from pathlib import Path
from gmail_export import export_email_content
from parser_fave import main as parse_fave
from parser_grab import main as parse_grab
from parser_paylah import main as parse_paylah
OUTPUT_DIR = Path("output")
def paylah_main(output_dir: Path = OUTPUT_DIR):
### Export PayLah Emails
paylah_dir = output_dir / "paylah"
paylah_dir.mkdir(exist_ok=True, parents=True)
export_email_content(
out_dir=paylah_dir,
sender="paylah.alert@dbs.com",
use_cache=True,
)
### Parse All PayLah Emails
parse_paylah(output_dir=output_dir)
def fave_main(output_dir: Path = OUTPUT_DIR):
### Export Fave Emails
fave_dir = output_dir / "fave"
fave_dir.mkdir(exist_ok=True, parents=True)
export_email_content(
out_dir=fave_dir,
sender="hi@myfave.com",
use_cache=True,
)
### Parse All Fave Emails
parse_fave(output_dir=output_dir)
def grab_main(output_dir: Path = OUTPUT_DIR):
### Export Grab Emails
grab_dir = output_dir / "grab"
grab_dir.mkdir(exist_ok=True, parents=True)
export_email_content(
out_dir=grab_dir,
sender="no-reply@grab.com",
use_cache=True,
)
### Parse All Grab Emails
parse_grab(output_dir=output_dir)
if __name__ == "__main__":
# fave_main()
# paylah_main()
grab_main()