Skip to content

Check if the past NHL game was HOT or not. If it worth watching a replay.

Notifications You must be signed in to change notification settings

vtashlikovich/nhl-game-hotness

Repository files navigation

NHL game hotness meter

About

If you love hockey, NHL, if you track your favorite teams' progress but eager to see any really hot game replays... But you are stuck to determine which one is good? This tool will help.

This python CLI utility analyzes NHL game data and calculates hottness points. If you see HOT next to the game - that's worth seeing. If you get WOW! next to the game - you must watch this.

NHL game hottness log

How scoring is done

Scoring is calculated on the base of data provided by public NHL API (https://api-web.nhle.com/v1/).

gamestats.py lib uses the following metrics to get points for each game.

Overtime. If teams got to OT.

Shootout. If teams reached to SO.

Long shootout. If rounds are more than 3.

Extra long shootout. If rounds are more than 7.

Tight fight. 28+ shots made by both teams.

The wall. 35+ saves by any goalkeeper in regular.

High tension. When regular ends with score 4:4+.

Last chance. When OT set up in the last minute.

Last chance 20. When OT set up in the 20 seconds.

Last chance 5. When OT set up in the 5 seconds.

Late winner. Winning goal in the last 15 seconds of OT.

Tight win. Both teams score 2+, regular ends with 1 puck difference only.

Late tight win. Tight win and the winning goal is within the last minute or 20 seconds of the 3rd.

Come back. One team scores 3+ straight that leads to even score or advantage.

Equal game. Both teams tie the game 2 times.

Equal game 3. Both teams tie the game at least 3 times per game.

Missed chance. 3rd period, no goalkeeper but opponent scores.

Hat trick. 1 player gets a hatty.

Poker. 1 player gets a poker.

Mad scorer. 1 player scores 5+.

Star points. Star player has 1 point in the game.

Star shines. Star player has 2+ goals, 2+ assists or 3+ points.

Points master. Player (not a star) gets 3+ points per game.

How to run

How to run tests:

$ pytest tests/

How to run analysis:

# get hockey games points for the last 3 days
$ python games.py

# get hockey games points for the period from DATE to the current date
# DATE is of YYYY-MM-DD format
$ python games.py -d DATE

# dump results into json file
$ python games.py -f file.json

# do not output scores into console
$ python games.py -s

# dump results into json file saved to location: dir/YYYY-MM-DD.json
$ python games.py -l dir

# get hottness points for a single game
$ python onegame.py GAME_ID

Or make index.py and onegame.py files runnable (Unix/Linux/MacOs) and run as a bash script.

$ chmod +x index.py

$ ./games.py

Enjoy!

About

Check if the past NHL game was HOT or not. If it worth watching a replay.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published