-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (26 loc) · 905 Bytes
/
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
import requests
import pandas as pd
from bs4 import BeautifulSoup
import re
import argparse
from nbawebscraper.all_stats import all_stats
from nbawebscraper.player_stats import player_stats
from nbawebscraper.player_twitter import get_twitter
from nbawebscraper.player_personal import get_personal_info
def main():
""" Main entry point of the app """
parser = argparse.ArgumentParser()
parser.add_argument('command', type=str)
parser.add_argument('--season', type=int, default=2022)
parser.add_argument('--team', type=str, default="GSW")
args = parser.parse_args()
commands = {
"all": lambda _, season: all_stats(season),
"player": player_stats,
"twitter": get_twitter,
"personal": get_personal_info
}
if args.command in commands:
print(commands[args.command](args.team, args.season))
if __name__ == "__main__":
main()