Skip to content

Instantly share code, notes, and snippets.

@marcolussetti
Last active July 12, 2017 18:43
Show Gist options
  • Save marcolussetti/3f71796494e8f9655b99287a6aa110cf to your computer and use it in GitHub Desktop.
Save marcolussetti/3f71796494e8f9655b99287a6aa110cf to your computer and use it in GitHub Desktop.
NFL Player Info using nfldb
#!/usr/bin/env python2.7
# Queries nfldb for the team & position of a player
import nfldb
import sys
db = nfldb.connect()
q = nfldb.Query(db)
if len(sys.argv) < 2:
argument = raw_input("Enter player name: ")
else:
argument = ' '.join(sys.argv[1:])
q.player(full_name=argument)
for p in q.as_players():
print p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment