diff --git a/espn_api/hockey/player.py b/espn_api/hockey/player.py index c8f7d1d4..2d245935 100644 --- a/espn_api/hockey/player.py +++ b/espn_api/hockey/player.py @@ -1,5 +1,3 @@ -import pandas as pd - from espn_api.utils.utils import json_parsing from .constant import POSITION_MAP, STATS_MAP, PRO_TEAM_MAP, STATS_IDENTIFIER @@ -16,7 +14,6 @@ def __init__(self, data): self.proTeam = PRO_TEAM_MAP[json_parsing(data, 'proTeamId')] self.injuryStatus = json_parsing(data, 'injuryStatus') self.stats = {} - self.df = {} ''' Options @@ -48,16 +45,6 @@ def __init__(self, data): def __repr__(self): return 'Player(%s)' % (self.name,) - def to_df(self, stat: str) -> pd.DataFrame: - if stat not in self.df: - self.df[stat] = pd.DataFrame(self.stats[stat]['total'], index= [self.name]) - - self.df[stat]['Team'] = [self.proTeam] - self.df[stat]['Position'] = [self.position] - self.df[stat]['lineUpSlot'] = [self.lineupSlot] - - return self.df[stat] - def get_stat_key(id: str) -> str: if id[:2] in STATS_IDENTIFIER: stat_type = STATS_IDENTIFIER[id[:2]] diff --git a/espn_api/hockey/team.py b/espn_api/hockey/team.py index 9e358eb8..c8c7341a 100644 --- a/espn_api/hockey/team.py +++ b/espn_api/hockey/team.py @@ -1,5 +1,3 @@ -import pandas as pd - from .constant import STATS_MAP from .matchup import Matchup from .player import Player @@ -25,7 +23,6 @@ def __init__(self, data, member, roster, schedule, year): self.roster = [] self.schedule = [] self.year = year - self.roster_df = {} if 'valuesByStat' in data: self.stats = {STATS_MAP[i]: j for i, j in data['valuesByStat'].items()} @@ -60,13 +57,4 @@ def _fetch_schedule(self, data): elif match['home']['teamId'] == self.team_id: new_match = Matchup(match) setattr(new_match, 'home_team', self) - self.schedule.append(new_match) - - def get_roster_df(self, stat: str = None): - if not stat: - stat = 'Total {}'.format(self.year) - - if stat not in self.roster_df: - self.roster_df[stat] = pd.concat([player.to_df(stat) for player in self.roster], sort=False) - - return self.roster_df[stat] + self.schedule.append(new_match) \ No newline at end of file diff --git a/setup.py b/setup.py index 8ec421f3..88a26ceb 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,10 @@ setup( name='espn_api', packages=find_packages(), - version='0.17.0', + version='0.18.0', author='Christian Wendt', description='ESPN API', - install_requires=['requests>=2.0.0,<3.0.0', 'pandas>=0.11.0,<=0.25.3', 'numpy>=1.15,<=1.17.5'], + install_requires=['requests>=2.0.0,<3.0.0'], setup_requires=['nose>=1.0'], test_suite='nose.collector', tests_require=['nose', 'requests_mock', 'coverage'],