Baseball Files

gameday_linescore

GameDay XML - Game Line Score.

http://gd2.mlb.com/components/game/mlb/year_####/month_##/day_##/gid_####_##_##_???mlb_???mlb_#/linescore.xml

classes:
    GameDayLineScore (GameDayXML)

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
December 2011

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_linescore [command] [team-code=min] [date=None] [forceGET=True]

commands:
    main            - Default function
    spcl            - Special function
    today           - Get Game Events for today
    today1          - Get Game Events for yesterday
    today2          - Get Game Events for day before yesterday

function main

Get GameDay LineScore XML for a given Date and Team Code.

type GameDayLineScore

GameDay Line Score Class.

properties:
    .gid                    "id"
    .day                    "day"
    .time                   "time"
    .ampm                   "ampm"
    .tz                     "time_zone"
    .venue                  "venue"
    .venueId                "venue_id"
    .lg                     "league"
    .gameType               "game_type"
    .pk                     "game_pk"
    .sw                     "gameday_sw"
    .wchan                  "venue_w_chan_loc"

    .ind                    "ind"
    .status                 "status"
    .innings                "scheduled_innings"
    .inning                 "inning"
    .inning_top             "top_inning"
    .inning_state           "inning_state"
    .outs                   "outs"

    .awayId                 "away_team_id"
    .awayRuns               "away_team_runs"
    .awayHits               "away_team_hits"
    .awayErrs               "away_team_errors"
    .awayWins               "away_win"
    .awayLoss               "away_loss"
    .awayName               "away_team_name"
    .awayCity               "away_team_city"
    .awayAbbr               "away_name_abbrev"
    .awayCode               "away_code"
    .awayDiv                "away_division"
    .awayLgId               "away_league_id"
    .awayGB                 "away_games_back"
    .awayWC                 "away_games_back_wildcard"
    .awayTime               "away_time"
    .awayTZ                 "away_time_zone"
    .awayAP                 "away_ampm"
    .awayFile               "away_file_code"
    .awaySport              "away_sport_code"

    .homeId                 "home_team_id"
    .homeRuns               "home_team_runs"
    .homeHits               "home_team_hits"
    .homeErrs               "home_team_errors"
    .homeWins               "home_win"
    .homeLoss               "home_loss"
    .homeName               "home_team_name"
    .homeCity               "home_team_city"
    .homeAbbr               "home_name_abbrev"
    .homeCode               "home_code"
    .homeDiv                "home_division"
    .homeLgId               "home_league_id"
    .homeGB                 "home_games_back"
    .homeWC                 "home_games_back_wildcard"
    .homeTime               "home_time"
    .homeTZ                 "home_time_zone"
    .homeAP                 "home_ampm"
    .homeFile               "home_file_code"
    .homeSport              "home_sport_code"

    .awayBox[]              - away box scores
    .homeBox[]              - home box scores
    .WP.<Pitcher>           - winning Pitcher
    .LP.<Pitcher>           - losing Pitcher
    .SP.<Pitcher>           - losing Pitcher

methods:
    .filename()             - "linescore.xml"
    .save_html()            - generate HTML using XSLT from XML
    len(obj)                - number of innings
    str(obj)                - Box Score string
    repr(obj)               - JSON-like string