2024-04-16 21:23:27 +00:00
|
|
|
import argparse
|
2024-04-16 22:45:15 +00:00
|
|
|
import logging
|
2024-04-16 21:23:27 +00:00
|
|
|
|
2024-04-23 20:58:25 +00:00
|
|
|
import personal_data.main
|
|
|
|
|
|
|
|
|
2024-04-16 21:23:27 +00:00
|
|
|
def parse_arguments():
|
2024-04-28 21:45:47 +00:00
|
|
|
available_scraper_names = personal_data.main.available_scraper_names()
|
2024-04-16 21:23:27 +00:00
|
|
|
parser = argparse.ArgumentParser()
|
2024-05-09 14:59:56 +00:00
|
|
|
parser.add_argument(
|
|
|
|
'fetchers',
|
|
|
|
metavar='FETCHER',
|
|
|
|
type=str,
|
|
|
|
nargs='+',
|
|
|
|
choices=available_scraper_names,
|
|
|
|
)
|
2024-04-23 20:58:25 +00:00
|
|
|
parser.add_argument('--cookiejar', action='store_true')
|
2024-05-09 14:59:56 +00:00
|
|
|
parser.add_argument('--email', action='store_true', dest='send_email_notification')
|
2024-04-16 21:23:27 +00:00
|
|
|
return parser.parse_args()
|
|
|
|
|
2024-04-23 20:58:25 +00:00
|
|
|
|
2024-04-16 21:23:27 +00:00
|
|
|
def main():
|
2024-04-16 22:45:15 +00:00
|
|
|
logging.basicConfig()
|
|
|
|
logging.getLogger('personal_data').setLevel('INFO')
|
2024-04-16 21:23:27 +00:00
|
|
|
args = parse_arguments()
|
|
|
|
scraper_filter = frozenset(args.fetchers)
|
2024-05-09 14:59:56 +00:00
|
|
|
personal_data.main.main(
|
|
|
|
scraper_filter,
|
|
|
|
use_cookiejar=args.cookiejar,
|
|
|
|
send_email_notification=args.send_email_notification,
|
|
|
|
)
|
2024-04-23 20:58:25 +00:00
|
|
|
|
2024-03-31 22:55:55 +00:00
|
|
|
|
2023-12-10 23:27:56 +00:00
|
|
|
if __name__ == '__main__':
|
2024-04-16 21:23:27 +00:00
|
|
|
main()
|