Skip to content

Instantly share code, notes, and snippets.

@ochawkeye
Created September 23, 2015 17:01
Show Gist options
  • Save ochawkeye/e5407497c92f1d1133ae to your computer and use it in GitHub Desktop.
Save ochawkeye/e5407497c92f1d1133ae to your computer and use it in GitHub Desktop.
Amari Cooper in NFLDB
import nfldb
name = 'Amari Cooper'
team = 'OAK'
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2015, season_type='Regular')
q.player(full_name=name, team=team)
print '{} has appeared in {} plays in 2015'.format(name, len(q.as_plays()))
for pp in q.as_plays():
print pp
@ochawkeye
Copy link
Author

Amari Cooper has appeared in 20 plays in 2015
(OAK, OWN 20, Q1, 1 and 10) (15:00) (Shotgun) D.Carr pass incomplete short left to A.Cooper.
(OAK, OWN 20, Q1, 1 and 10) (7:15) (Shotgun) D.Carr pass incomplete short left to A.Cooper (A.Jones).
(OAK, OWN 20, Q1, 2 and 10) (7:12) D.Carr pass incomplete short right to A.Cooper. Penalty on OAK-A.Cooper, Offensive Pass Interference, declined.
(OAK, OWN 9, Q1, 2 and 8) (2:01) (No Huddle, Shotgun) D.Carr pass short middle to A.Cooper to OAK 15 for 6 yards (G.Iloka). PENALTY on CIN-G.Iloka, Unsportsmanlike Conduct, 15 yards, enforced at OAK 15.
(OAK, OWN 34, Q1, 3 and 6) (:09) (Shotgun) D.Carr pass short left to A.Cooper to CIN 42 for 24 yards (C.Carter; G.Iloka). PENALTY on OAK-R.Hudson, Unnecessary Roughness, 15 yards, enforced at CIN 42.
(OAK, OWN 41, Q3, 2 and 3) (12:35) (Shotgun) M.McGloin pass short left to A.Cooper to OAK 46 for 5 yards (A.Jones).
(OAK, OPP 48, Q4, 2 and 9) (14:35) (No Huddle, Shotgun) M.McGloin pass incomplete short right to A.Cooper.
(OAK, OPP 41, Q4, 2 and 5) (10:50) (Shotgun) M.McGloin pass short right to A.Cooper to CIN 43 for -2 yards (L.Hall).
(OAK, OPP 39, Q4, 4 and 3) (9:32) (Shotgun) M.McGloin pass short middle to A.Cooper to CIN 25 for 14 yards (D.Dennard).
(OAK, OWN 26, Q1, 2 and 4) (14:25) (Shotgun) D.Carr pass incomplete short left to A.Cooper.
(OAK, OWN 30, Q1, 1 and 10) (13:34) (Shotgun) D.Carr pass incomplete short middle to A.Cooper.
(OAK, OWN 32, Q1, 3 and 8) (12:59) (Shotgun) D.Carr pass deep left to A.Cooper for 68 yards, TOUCHDOWN [C.Mosley].
(OAK, OWN 39, Q1, 3 and 2) (5:02) (Shotgun) D.Carr pass short right to A.Cooper to OAK 47 for 8 yards (L.Webb).
(OAK, OWN 20, Q2, 1 and 10) (7:44) (Shotgun) D.Carr pass short left to A.Cooper pushed ob at OAK 28 for 8 yards (E.Dumervil). PENALTY on BAL-J.Smith, Unnecessary Roughness, 15 yards, enforced at OAK 28.
(OAK, OWN 43, Q2, 1 and 10) (7:14) (Shotgun) D.Carr pass short right to A.Cooper pushed ob at OAK 49 for 6 yards (W.Hill).
(OAK, OPP 37, Q2, 2 and 15) (3:34) (Shotgun) D.Carr pass short middle to A.Cooper to BAL 32 for 5 yards (K.Arrington).
(OAK, OWN 42, Q3, 1 and 10) (12:43) (Shotgun) D.Carr pass short right to A.Cooper pushed ob at OAK 47 for 5 yards (J.Smith).
(OAK, OWN 47, Q3, 1 and 10) (2:53) (Shotgun) D.Carr pass incomplete short left to A.Cooper (C.Mosley).
(OAK, OWN 23, Q4, 3 and 7) (12:50) (Shotgun) D.Carr pass incomplete deep left to A.Cooper (J.Smith).
(OAK, OPP 40, Q4, 1 and 15) (:52) D.Carr pass short left to A.Cooper to BAL 31 for 9 yards (C.Mosley, K.Arrington).

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