1
0
personal-data/personal_data/__main__.py
Jon Michael Aanes 7eb4b0bb09
All checks were successful
Build container / Package-Python (push) Successful in 25s
Build container / Package-Container (push) Successful in 1m20s
Ruff
2024-05-09 16:59:56 +02:00

36 lines
902 B
Python

import argparse
import logging
import personal_data.main
def parse_arguments():
available_scraper_names = personal_data.main.available_scraper_names()
parser = argparse.ArgumentParser()
parser.add_argument(
'fetchers',
metavar='FETCHER',
type=str,
nargs='+',
choices=available_scraper_names,
)
parser.add_argument('--cookiejar', action='store_true')
parser.add_argument('--email', action='store_true', dest='send_email_notification')
return parser.parse_args()
def main():
logging.basicConfig()
logging.getLogger('personal_data').setLevel('INFO')
args = parse_arguments()
scraper_filter = frozenset(args.fetchers)
personal_data.main.main(
scraper_filter,
use_cookiejar=args.cookiejar,
send_email_notification=args.send_email_notification,
)
if __name__ == '__main__':
main()