"""
)
# print len(player_list)
boxscores = sq3reader.executeQueryDict(
    """SELECT id, vteamstr, hteamstr
		from boxscore where gamedate='"""
    + myDate
    + """'
		"""
)
# GET DK Salary
dksalary = DKSalary("input/" + myDate + "_DKSalaries.csv")
dkdata = dksalary.getDkdata()

# Load DK UTIL
dkutil = DKUtil(sq3reader, player_list, boxscores, dkdata, {"logging": "on"})


def filter(playerData):
    if playerData["time_on_ice_s"] > 920 and playerData["fppg"] > 2.2:
        return True
    else:
        return False


# David Krejci|Patrice Bergeron|Ryan O'Reilly|Brad Marchand|Alex Ovechkin|Oliver Ekman-Larsson|Rasmus Ristolainen
# def filter(playerData):
# if (playerData['time_on_ice_s'] > 1020 and playerData['fppg'] > 2
# and playerData['player']!='David Krejci'
# and playerData['player']!='Patrice Bergeron'
# and playerData['player']!='Ryan O\'Reilly'
예제 #2
0
myPlayers = []
sq3reader = SQ3Reader('db/'+myDate+'_boxscores.db', {'logging':'on'})
player_list = sq3reader.executeQueryDict("""SELECT distinct d.player, d.team
		from boxscore_data d, boxscore b WHERE d.boxscore = b.id
		AND b.season='"""+myYear+"""'
		""")
#print len(player_list)
boxscores = sq3reader.executeQueryDict("""SELECT id, vteamstr, hteamstr
		from boxscore where gamedate='"""+myDate+"""'
		""")
#GET DK Salary
dksalary = DKSalary('input/'+myDate+'_DKSalaries.csv')
dkdata = dksalary.getDkdata()

#Load DK UTIL
dkutil = DKUtil(sq3reader, player_list, boxscores, dkdata, {'logging':'on'})

def filter(playerData):
	if (playerData['time_on_ice_s'] > 1060 and playerData['fppg'] > 2.5):
		return True
	else:
		return False
#David Krejci|Patrice Bergeron|Ryan O'Reilly|Brad Marchand|Alex Ovechkin|Oliver Ekman-Larsson|Rasmus Ristolainen
#def filter(playerData):
	#if (playerData['time_on_ice_s'] > 1020 and playerData['fppg'] > 2
	#and playerData['player']!='David Krejci'
	#and playerData['player']!='Patrice Bergeron'
	#and playerData['player']!='Ryan O\'Reilly'
	#and playerData['player']!='Brad Marchand'
	#and playerData['player']!='Alex Ovechkin'
	#and playerData['player']!='Oliver Ekman-Larsson'
예제 #3
0
myPlayers = []
sq3reader = SQ3Reader('db/'+myDate+'_boxscores.db', {'logging':'off'})
player_list = sq3reader.executeQueryDict("""SELECT distinct d.player, d.team
		from boxscore_data d, boxscore b WHERE d.boxscore = b.id
		AND b.season='"""+myYear+"""'
		""")
#print len(player_list)
boxscores = sq3reader.executeQueryDict("""SELECT id, vteamstr, hteamstr
		from boxscore where gamedate='"""+myDate+"""'
		""")
#GET DK Salary
dksalary = DKSalary('input/'+myDate+'_DKSalaries.csv')
dkdata = dksalary.getDkdata()

#Load DK UTIL
dkutil = DKUtil(sq3reader, player_list, boxscores, dkdata, {'logging':'off'})

def filter(playerData):
	#if playerData['time_on_ice_s'] > 720 and playerData['fppg'] > 2 and playerData['player']!='Mike Hoffman' and playerData['player']!='Evgeny Kuznetsov' and playerData['player']!='Nicklas Backstrom':
	#	return True
	#else:
	#	return False
	return True
dkutil.generatePlayerData(myDate, '2016', filter)

player_stats = dkutil.getPlayerStats(myPosition)
json_player_data = json.dumps(player_stats)

player_stats_sorted = sorted(player_stats, key=itemgetter('time_on_ice_s'), reverse=True)
print template.render(player_stats=player_stats_sorted, json_player_data=json_player_data, date=myDate, position=myPosition)
myPlayers = []
sq3reader = SQ3Reader('db/'+myDate+'_boxscores.db', {'logging':'off'})
player_list = sq3reader.executeQueryDict("""SELECT distinct d.player, d.team
		from boxscore_data d, boxscore b WHERE d.boxscore = b.id
		AND b.season='"""+myYear+"""'
		""")
#print len(player_list)
boxscores = sq3reader.executeQueryDict("""SELECT id, vteamstr, hteamstr
		from boxscore where gamedate='"""+myDate+"""'
		""")
#GET DK Salary
dksalary = DKSalary('input/'+myDate+'_DKSalaries.csv')
dkdata = dksalary.getDkdata()

#Load DK UTIL
dkutil = DKUtil(sq3reader, player_list, boxscores, dkdata, {'logging':'on'})

def filter(playerData):
	if (playerData['time_on_ice_s'] > 1020 and playerData['fppg'] > 2.5):
		return True
	else:
		return False
#David Krejci|Patrice Bergeron|Ryan O'Reilly|Brad Marchand|Alex Ovechkin|Oliver Ekman-Larsson|Rasmus Ristolainen
#def filter(playerData):
	#if (playerData['time_on_ice_s'] > 1020 and playerData['fppg'] > 2
	#and playerData['player']!='David Krejci'
	#and playerData['player']!='Patrice Bergeron'
	#and playerData['player']!='Ryan O\'Reilly'
	#and playerData['player']!='Brad Marchand'
	#and playerData['player']!='Alex Ovechkin'
	#and playerData['player']!='Oliver Ekman-Larsson'