10
10
import mlbgame .object
11
11
12
12
from datetime import datetime
13
- import dateutil .parser
14
13
import json
15
14
import lxml .etree as etree
16
15
import requests
@@ -135,16 +134,13 @@ def roster(team_id):
135
134
data = mlbgame .data .get_roster (team_id )
136
135
parsed = json .loads (data .read ().decode ('utf-8' ))
137
136
players = parsed ['roster_40' ]['queryResults' ]['row' ]
138
- last_update = dateutil .parser .parse (
139
- parsed ['roster_40' ]['queryResults' ]['created' ])
140
- return {'players' : players , 'last_update' : last_update , 'team_id' : team_id }
137
+ return {'players' : players , 'team_id' : team_id }
141
138
142
139
143
140
class Roster (object ):
144
141
"""Represents an MLB Team
145
142
146
143
Properties:
147
- last_update
148
144
players
149
145
team_id
150
146
"""
@@ -154,7 +150,6 @@ def __init__(self, data):
154
150
155
151
`data` should be a dictionary of values.
156
152
"""
157
- self .last_update = data ['last_update' ]
158
153
self .team_id = data ['team_id' ]
159
154
self .players = []
160
155
for player in data ['players' ]:
@@ -217,8 +212,6 @@ def standings(date):
217
212
data = mlbgame .data .get_historical_standings (date )
218
213
standings_schedule_date = 'historical_standings_schedule_date'
219
214
parsed = json .loads (data .read ().decode ('utf-8' ))
220
- last_update = parsed [standings_schedule_date ][
221
- 'standings_all_date_rptr' ]['standings_all_date' ][0 ]['queryResults' ]['created' ]
222
215
sjson = parsed [standings_schedule_date ]['standings_all_date_rptr' ]['standings_all_date' ]
223
216
for league in sjson :
224
217
if league ['league_id' ] == '103' :
@@ -235,7 +228,6 @@ def standings(date):
235
228
return {
236
229
'standings_schedule_date' : standings_schedule_date ,
237
230
'divisions' : divisions ,
238
- 'last_update' : dateutil .parser .parse (last_update )
239
231
}
240
232
241
233
@@ -245,7 +237,6 @@ class Standings(object):
245
237
Properties:
246
238
divisions
247
239
standings_schedule_date
248
- last_update
249
240
"""
250
241
251
242
def __init__ (self , data ):
@@ -254,7 +245,6 @@ def __init__(self, data):
254
245
`data` should be a dictionary of values
255
246
"""
256
247
self .standings_schedule_date = data ['standings_schedule_date' ]
257
- self .last_update = data ['last_update' ]
258
248
self .divisions = [Division (x ['division' ], x ['teams' ]) for x in data ['divisions' ]]
259
249
260
250
0 commit comments