Skip to content

Instantly share code, notes, and snippets.

@ochawkeye
Created August 12, 2016 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochawkeye/27d208e950fb37beb8fe8107e0d9d35e to your computer and use it in GitHub Desktop.
Save ochawkeye/27d208e950fb37beb8fe8107e0d9d35e to your computer and use it in GitHub Desktop.
"""Display a chart of games that have and have not yet been played for a given week."""
import nflgame
def started_ticker(game):
print '{}\t{}\t\t{}'.format(game.away, game.score_away, game.time)
print '{}\t{}'.format(game.home, game.score_home)
print '-'*25
def unstarted_ticker(game):
date = '{}/{}/{}'.format(game['month'], game['day'], game['year'])
print '{}\t\t\t{} {}'.format(game['away'], game['wday'], date)
print '{}\t\t\t{}'.format(game['home'], game['time'])
print '-'*25
def print_started_and_unstarted_games(year, week, kind):
started_game_eids = [g.eid for g in nflgame.games_gen(year=year, week=week, kind=kind)]
unstarted_games = [g for g in nflgame.live._games_in_week(year, week, kind) if g['eid'] not in started_game_eids]
print '{} Week {} {}'.format(kind, week, year)
for game in unstarted_games:
unstarted_ticker(game)
for game in nflgame.games_gen(year=year, week=week, kind=kind):
started_ticker(game)
print_started_and_unstarted_games(2016, 1, 'REG')
@ochawkeye
Copy link
Author

ochawkeye commented Aug 12, 2016

REG Week 1 2016
CAR Thu 9/8/2016
DEN 8:30

TB Sun 9/11/2016
ATL 1:00

BUF Sun 9/11/2016
BAL 1:00

CHI Sun 9/11/2016
HOU 1:00

GB Sun 9/11/2016
JAX 1:00

SD Sun 9/11/2016
KC 1:00

OAK Sun 9/11/2016
NO 1:00

CIN Sun 9/11/2016
NYJ 1:00

CLE Sun 9/11/2016
PHI 1:00

MIN Sun 9/11/2016
TEN 1:00

MIA Sun 9/11/2016
SEA 4:05

NYG Sun 9/11/2016
DAL 4:25

DET Sun 9/11/2016
IND 4:25

NE Sun 9/11/2016
ARI 8:30

PIT Mon 9/12/2016
WAS 7:10

LA Mon 9/12/2016
SF 10:20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment