Baseball Files
gameday_innings
GameDay XML - Game Innings.
http://gd2.mlb.com/components/game/mlb/year_####/month_##/day_##/gid_####_##_##_???mlb_???mlb_#/inning/inning_all.xml
classes:
GameDayInnings (GameDayXML)
InningAtBat
InningAtBatPitch
InningAtBatRunner
InningAtBatPickoff
InningAction
functions:
dispatch(cmd,[args]) - Module Command Dispatch
main() - Default function
RefreshDates(dts) - Reload XML files (forceGET=True)
GenerateAllHTML() - Run XSLT on all XML files
Developer@Sonnack.com
April 2012
function GenerateAllHTML
Generate all HTML. Uses the object's XSLT to process all existing XML files.
function RefreshDates
Refresh database (forced GET, save XML & HTML) given a List of Dates.
function dispatch
Dispatch Command.
usage:
gameday_innings [command] [team-code=min] [date=None] [forceGET=False]
commands:
main - Default function
spcl - Special function
today - Get Innings for today
today1 - Get Innings for yesterday
today2 - Get Innings for day before yesterday
today3 - Get Innings for 3 days ago
today4 - Get Innings for 4 days ago
today5 - Get Innings for 5 days ago
function main
Get GameDay Innings XML for a given Date and Team Code.
function print_inning
type GameDayInnings
GameDay Innings Class.
An Inning Object is a tuple:
(inning#, [top-events], [bot-events], away-team, home-team)
Event Objects are InningAtBat and InningAction instances.
properties:
.innings - array of inning objects
.status "ind"
.atbat "atbat"
.ondeck "deck"
.inhole "hold"
methods:
.filename() - "inning_all.xml"
.pathname() - "innings"
.xmlprefix() - "inning/"
.save_html() - generate HTML using XSLT from XML
len(obj) - number of innings
obj[index] - Get Inning [index]
iter(obj) - Get an iterator
str(obj) - innings string
repr(obj) - JSON-like string
type InningAction
GameDay Inning Action Instance.
properties:
.tfsz "tfs_zulu"
.tfs "tfs"
.des "des"
.event "event"
.player "player"
.o "o"
.b "b"
.s "s"
.pitch "pitch"
methods:
.timestamp() - timedate string
str(obj) - Action string
repr(obj) - JSON-like string
type InningAtBat
GameDay Inning AtBat Instance.
properties:
.events[] - List of Pitch/Runner/PO events
.num "num"
.tfsz "start_tfs_zulu"
.tfs "start_tfs"
.des "des"
.event "event"
.event2 "event2"
.score "score"
.pitcher "pitcher"
.batter "batter"
.b_height "b_height"
.b_stands "b_stands"
.p_throws "p_throws"
.o "o"
.b "b"
.s "s"
.away_team_runs "away_team_runs"
.home_team_runs "home_team_runs"
methods:
.timestamp() - timedate string
str(obj) - AtBat string
repr(obj) - JSON-like string
type InningAtBatPickoff
GameDay Inning AtBat Pickoff Instance.
properties:
.des "des"
methods:
str(obj) - AtBat Pickoff string
repr(obj) - JSON-like string
type InningAtBatPitch
GameDay Inning AtBat Pitch Instance.
properties:
.pid "id"
.tfsz "tfs_zulu"
.tfs "tfs"
.des "des"
.e_type "type"
.p_type "pitch_type"
.sv_id "sv_id"
.on_1b "on_1b"
.on_2b "on_2b"
.on_3b "on_3b"
.start_speed ""
.end_speed ""
.spin_dir ""
.spin_rate ""
.break_angle ""
.break_length ""
.break_y ""
.px ""
.pz ""
.pfx_x ""
.pfx_z ""
.x ""
.y ""
.ax ""
.ay ""
.az ""
.x0 ""
.y0 ""
.z0 ""
.vx0 ""
.vy0 ""
.vz0 ""
.sz_bot ""
.sz_top ""
.cc ""
.mt ""
.type_confidence ""
.nasty ""
.zone ""
methods:
.timestamp() - timedate string
str(obj) - AtBat Pitch string
repr(obj) - JSON-like string
type InningAtBatRunner
GameDay Inning AtBat Runner Instance.
properties:
.pid "id"
.event "event"
.start "start"
.end "end"
.score "score"
.earned "earned"
.rbi "rbi"
methods:
str(obj) - AtBat Runner string
repr(obj) - JSON-like string