nhl¶
Classes
|
NHL conference object. |
|
NHL division object. |
|
NHL event object. |
|
NHL franchise object. |
|
NHL game object. |
|
NHL game info. |
|
NHL gametime object. |
|
Searchable, sortable, and filter-able |
|
NHL location object. |
|
NHL official object. |
|
NHL player object. |
|
NHL player statistics. |
|
NHL shift object. |
|
NHL team object. |
|
NHL venue object. |
-
class
nhl.
Conference
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL conference object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
abbreviation
: str¶ Conference abbreviation
- Type
str
-
id
: int¶ The NHL statsapi universal conference ID
- Type
int
-
name
: str¶ Conference name
- Type
str
-
name_short
: str¶ Conference name shortened
- Type
str
-
classmethod
-
class
nhl.
Division
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL division object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
abbreviation
: str¶ Division abbreviated name
- Type
str
-
id
: int¶ The NHL statsapi universal division ID
- Type
int
-
name
: str¶ Division name
- Type
str
-
name_short
: str¶ Division short name
- Type
int
-
classmethod
-
class
nhl.
Event
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL event object.
This is the detailed docstring.
-
classmethod
from_key
(game_id, id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(game_id, id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
by_player
: nhl.player.Player¶
-
by_players_on_ice
: nhl.list.List¶
-
property
by_strength
¶
-
by_team
: nhl.team.Team¶
-
game_id
: int¶
-
gametime
: nhl.gametime.Gametime¶
-
id
: int¶
-
property
lead
¶
-
location
: nhl.location.Location¶
-
property
name
¶
-
on_player
: nhl.player.Player¶
-
on_players_on_ice
: nhl.list.List¶
-
property
on_strength
¶
-
on_team
: nhl.team.Team¶
-
score
: tuple¶
-
property
strength
¶
-
property
subname
¶
-
subtype
: str¶
-
type
: str¶
-
value
: float¶
-
property
valuename
¶
-
classmethod
-
class
nhl.
Franchise
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL franchise object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
id
: int¶ The NHL statsapi universal franchise ID
- Type
int
-
name
: str¶ Franchise name
- Type
str
-
classmethod
-
class
nhl.
Game
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL game object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
property
defensemen
¶
-
events
: nhl.list.List¶ List:
-
property
forwards
¶
-
property
goalies
¶
-
players
: nhl.list.List¶ List:
-
property
skaters
¶
-
classmethod
-
class
nhl.
GameInfo
(id: int, season_id: int, type: str, start: datetime.datetime, end: datetime.datetime, venue: nhl.venue.Venue, home_team: nhl.team.Team, away_team: nhl.team.Team, score: tuple, end_type: str, end_time: nhl.gametime.Gametime, referees: nhl.list.List, linesmen: nhl.list.List)[source]¶ Bases:
object
NHL game info.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
nhl.Game or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
property
away_score
¶
-
away_team
: nhl.team.Team¶
-
property
date
¶
-
property
description
¶
-
end
: datetime.datetime¶
-
end_time
: nhl.gametime.Gametime¶
-
end_type
: str¶
-
property
home_score
¶
-
home_team
: nhl.team.Team¶
-
id
: int¶
-
linesmen
: nhl.list.List¶
-
property
playoff_game
¶
-
property
playoff_round
¶
-
property
playoff_series
¶
-
referees
: nhl.list.List¶
-
score
: tuple¶
-
property
season
¶
-
season_id
: int¶
-
property
season_type
¶
-
start
: datetime.datetime¶
-
type
: str¶
-
venue
: nhl.venue.Venue¶
-
classmethod
-
class
nhl.
Gametime
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL gametime object.
This object represents a unique time of the game. There are convenience properties to convert the gametime into convenient formats.
- Parameters
period (int) – The period of the game.
period_sec (int) – The number of elapsed seconds in the period.
-
classmethod
from_key
(period, period_sec)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(period, period_sec)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
property
min_sec
¶ Elapsed minutes and seconds of the game.
- Type
(int, int)
-
period
: int¶ Game period. 1-3 for regulation. 4+ for overtime.
- Type
int
-
property
period_min_sec
¶ Elapsed minutes and seconds of the period.
- Type
(int, int)
-
period_sec
: int¶ Elapsed seconds of the period.
- Type
int
-
property
period_str
¶ Period number as string (i.e. “2nd”)
- Type
str
-
property
sec
¶ Elapsed seconds of the game.
- Type
int
-
class
nhl.
List
(iterable=(), /)[source]¶ Bases:
list
Searchable, sortable, and filter-able
list
subclass-
filter
(attr, value, compare='==')[source]¶ Filter list by a comparison of a given attribute (or chain or attributes).
- Parameters
attr (str) – attributes to be compared (with initial . omitted)
value (any) – value to compare attr against
compare (str) – comparison type “==”, “=”, “eq”: attr == value “!=”, “ne”: attr != value “>”, “gt”: attr > value “>=”, “ge”: attr >= value “<”, “lt”: attr < value “<=”, “le”: attr <= value “in”, “contains”: value in attr
- Returns
reduced list with items that satisfy filter criterion
- Return type
-
select
(attr, default=None)[source]¶ Select a given attribute (or chain or attributes) from the objects within the list.
- Parameters
attr (str) – attributes to be selected (with initial . omitted)
default (any) – value to return if given element in list doesn’t contain desired attribute
- Returns
list of selected attribute values
- Return type
-
sort
(key, reverse=False)[source]¶ Sort the list by key either ascending or descending.
- Parameters
key (str) – atrribute to sort by (with initial . omitted)
reverse (bool, optional) – reverse the direction of sort to descending, (default False, ascending)
- Returns
sorted list
- Return type
-
property
len
¶ Helper property to return length of list
- Returns
length of list len(self)
- Return type
int
-
-
class
nhl.
Location
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL location object.
This is the detailed docstring.
-
distance
(other)[source]¶ Measure distance between current location and another on-ice location.
- Parameters
other (Location) – location to measure distance from
- Returns
distance (ft)
- Return type
float
-
classmethod
from_key
(x, y)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(x, y)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
x
: int¶ Rink position in ft along x-axis (length) [-100, 100]
- Type
int
-
y
: int¶ Rink position in ft along y-axis (breadth) [-42, 42]
- Type
int
-
-
class
nhl.
Official
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL official object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
nhl.Official or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
property
first_name
¶ Official’s first name
- Type
str
-
id
: int¶ The NHL statsapi universal official ID
- Type
int
-
property
last_name
¶ Official’s last name
- Type
str
-
name
: str¶ Official’s full name
- Type
str
-
classmethod
-
class
nhl.
Player
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL player object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
property
age
¶ Current age in years
- Type
int
-
birth_city
: str¶ Player’s birth city
- Type
str
-
birth_country
: str¶ Player’s birth country
- Type
str
-
birth_date
: datetime.date¶ Player’s birth date
- Type
datetime.date
-
property
first_name
¶ Player’s first name
- Type
str
-
height
: int¶ Player’s height in total inches
- Type
int
-
id
: int¶ The NHL statsapi universal player ID
- Type
int
-
property
last_name
¶ Player’s last name
- Type
str
-
name
: str¶ Player’s full name
- Type
str
-
number
: int¶ Player’s primary number
- Type
int
-
position
: str¶ Player’s primary position (“LW”, “C”, “RW”, “D”, “G”)
- Type
str
-
shoots_catches
: str¶ Indication of whether the player shoots (skater)/catches (goalie) “L” or “R”
- Type
str
-
weight
: int¶ Player’s weight in lbs
- Type
int
-
classmethod
-
class
nhl.
PlayerStats
(player: nhl.player.Player, shifts: nhl.list.List, events: nhl.list.List)[source]¶ Bases:
object
NHL player statistics.
This is the detailed docstring.
-
class
nhl.
Shift
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL shift object.
This is the detailed docstring.
-
classmethod
from_key
(game_id, player_id, shift_id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(game_id, player_id, shift_id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
game_id
: int¶ NHL statsapi unique game ID
- Type
int
-
property
length
¶
-
property
player
¶
-
player_id
: int¶ NHL statsapi unique player ID
- Type
int
-
shift_id
: int¶ Shift number for specified game
- Type
int
-
classmethod
-
class
nhl.
Team
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL team object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
abbreviation
: str¶ Team’s name abbreviated
- Type
int
-
conference
: nhl.conference.Conference¶ Conference:
-
division
: nhl.division.Division¶ Division:
-
first_year
: int¶ First year of play
- Type
int
-
franchise
: nhl.franchise.Franchise¶ Franchise:
-
property
full_name
¶ Team’s full name
- Type
str
-
id
: int¶ The NHL statsapi universal team ID
- Type
int
-
location
: str¶ Team’s location
- Type
str
-
name
: str¶ Team’s name
- Type
str
-
classmethod
-
class
nhl.
Venue
(*args, **kwargs)[source]¶ Bases:
nhl.flyweight.Flyweight
NHL venue object.
This is the detailed docstring.
-
classmethod
from_key
(id)[source]¶ Return flyweight object with specified key, if it has already been created.
- Returns
Previously constructed flyweight object with given key or None if key not found
- Return type
cls or None
-
classmethod
has_key
(id)[source]¶ Check whether flyweight object with specified key has already been created.
- Returns
True if already created, False if not
- Return type
bool
-
id
: int¶ The NHL statsapi universal venue ID
- Type
int
-
name
: str¶ Venue name
- Type
str
-
classmethod