nhlpy
is an easy to use NHL API python wrapper. This wrapper was designed to be very "thin" and easy to use as it just provides helper functions that map directly to the NHL API, and it's purpose it to get you the data you need as quick as possible.
All data is returned as a python object of type dict
.
The NHL API does not require an API key to make requests so all you have to do is install this package and you can start using it!
The NHL API gives each team in the league an ID number. When working with the Team class, each instance of Team takes a team id as a parameter. For a list of known team id's please see the document team-ids.md.
golden_knights = Team(54)
print(golden_knights.info())
golden_knights = Team(54)
print(golden_knights.stats())
golden_knights = Team(54)
print(golden_knights.next_game())
nj_devils = Team(1)
print(nj_devils.last_game())
ny_rangers = Team(3)
print(ny_rangers.roster())
Note: Each one of the above methods makes a request to the NHL API
- Add a license
- Add tests
- Add CI
- Add code of conduct
- Prettify the JSON or
dict
output