- Get live data
./run.sh nym
- Watch live data, updated every minute
./run.sh nym 60
ℹ️ You can search for a team by any term that partially matches exactly one team by either name, location, or abbreviation.
If you ran quickstart script, this was done already.
- Create virtual env
$ python -m venv env
- Activate virtual env
$ source env/bin/activate
- Install packages
$ pip install -r requirements.txt
- Activate virtual env (see install above)
- Run script
$ python run.py query --team nym
$ python run.py query --team nym --date 2019-09-27
$ watch -t -d -n 60 "python run.py query --team nym"
By default teams with the names, abbreviations, and IDs are stored in teams.py
. In the unlikely event you need to update that list, run the following...
$ python fetch_team_ids.py > teams.py
Repo includes past games in certain states in games.p for easier debugging and development.
$ python run.py save --team nym --date 2019-09-27 --name pete-alonso
$ python run.py load
$ python run.py load --name pete-alonso
usage: run.py query [-h] --team TEAM [--date DATE] [--select {all,first,second,smart}]
optional arguments:
-h, --help show this help message and exit
--team TEAM team search term partical match for name, location, or abbreviation
--date DATE YYYY-MM-DD date to find game for, default today
--select {all,first,second,smart}
filter games list
python run.py save --help
usage: run.py save [-h] --team TEAM [--date DATE] --name NAME
optional arguments:
-h, --help show this help message and exit
--team TEAM team search term partical match for name, location, or abbreviation
--date DATE YYYY-MM-DD date to find game for, default today
--name NAME Save raw game data with input name to test with later
python run.py load --help
usage: run.py load [-h] [--name NAME]
optional arguments:
-h, --help show this help message and exit
--name NAME Load raw game data with input name instead of querying
--select {all,first,second,smart}
filter games list