Athletics Scorecard

Last Updated:
Athletics logo
HoleWinsLossesScore+2
15130-6(-2)
103744+2(+1)
Avg4437+33

Analysis

Here is a Python script to parse the given text and extract relevant information:

import re
from datetime import datetime

class Team:
    def __init__(self, name):
        self.name = name
        self.wins = 0
        self.losses = 0
        self.ties = 0

    def add_game_result(self, outcome):
        if outcome == 'W':
            self.wins += 1
        elif outcome == 'L':
            self.losses += 1
        else:
            self.ties += 1

class Season:
    def __init__(self, year=None):
        self.year = year
        self.teams = {}

    def add_team(self, team_name, team):
        if team_name not in self.teams:
            self.teams[team_name] = team
            print(f"Team {team_name} added to season.")

    def update_game_result(self, team_name, outcome):
        if team_name in self.teams:
            self.teams[team_name].add_game_result(outcome)
            print(f"{team_name}'s result updated.")
        else:
            print("Invalid team name.")

    def get_standings(self):
        sorted_teams = sorted(self.teams.values(), key=lambda t: (t.wins, t.losses), reverse=True)
        standings = []
        for i, team in enumerate(sorted_teams):
            standings.append({
                'Rank': i + 1,
                'Team': team.name,
                'W-L': f"{team.wins}-{team.losses}",
                'T': team.ties
            })
        return standings

def parse_season_data(data):
    teams = {}
    season_data = re.findall(r'(.*) (.*): (.*)', data)
    for result in season_data:
        team_name, outcome, _ = result
        if outcome not in ['W', 'L']:
            continue
        if outcome == 'W':
            add_team(teams, 'W')
        else:
            add_team(teams, 'L')
    # ... rest of the data processing ...

def main(data):
    season = Season()
    teams_list = re.findall(r'(.*) (.*?)', data)
    for team_name in teams_list:
        team_name, _ = team_name
        new_team = Team(team_name)
        season.add_team(new_team.name, new_team)
    # ... rest of the data processing ...

def main():
    data = """
         Seattle Mariners: 96-66
        Texas Rangers: 95-67
     Los Angeles Angels: 85-77
      Oakland Athletics: 74-88
       Tampa Bay Rays: 68-94
    Cleveland Indians: 102-60
       Chicago Cubs: 103-59
        Kansas City Royals: 97-65
       Boston Red Sox: 91-71
     Houston Astros: 101-61
         St. Louis Cardinals: 86-76
    New York Yankees: 84-78
      Colorado Rockies: 69-93
       Arizona Diamondbacks: 69-93
        San Diego Padres: 68-94
     Minnesota Twins: 83-79
       Baltimore Orioles: 74-88
      Cincinnati Reds: 64-98
         Los Angeles Dodgers: 91-71
    Philadelphia Phillies: 81-81
          Washington Nationals: 97-65
    San Francisco Giants: 82-80
        Miami Marlins: 62-100
       New York Mets: 70-92
        Pittsburgh Pirates: 69-93
         Chicago White Sox: 67-95
         Detroit Tigers: 60-102
         Toronto Blue Jays: 73-89
         Cleveland Indians: 102-60
    Los Angeles Dodgers: 91-71
       San Francisco Giants: 82-80
        Arizona Diamondbacks: 69-93
     Cincinnati Reds: 64-98
      Colorado Rockies: 69-93
        St. Louis Cardinals: 86-76
         Milwaukee Brewers: 74-88
    Kansas City Royals: 97-65
       Boston Red Sox: 91-71
         Texas Rangers: 95-67
    Tampa Bay Rays: 68-94
     Seattle Mariners: 96-66
        Houston Astros: 101-61
    Cleveland Indians: 102-60
      Oakland Athletics: 74-88
       Arizona Diamondbacks: 69-93
         Los Angeles Angels: 85-77
        Minnesota Twins: 83-79
         Chicago Cubs: 103-59
    Detroit Tigers: 50-112
     Milwaukee Brewers: 74-88
      Washington Nationals: 97-65
         St. Louis Cardinals: 86-76
       Boston Red Sox: 91-71
     New York Yankees: 84-78
        Colorado Rockies: 69-93
        San Diego Padres: 68-94
    Atlanta Braves: 85-77
      Baltimore Orioles: 74-88
         Texas Rangers: 95-67
       Los Angeles Dodgers: 91-71
    Arizona Diamondbacks: 69-93
         Philadelphia Phillies: 81-81
        Pittsburgh Pirates: 69-93
     Cincinnati Reds: 64-98
         Chicago White Sox: 67-95
       Miami Marlins: 62-100
         Toronto Blue Jays: 73-89
    Kansas City Royals: 97-65
        Cleveland Indians: 102-60
      Oakland Athletics: 74-88
     Houston Astros: 101-61
       St. Louis Cardinals: 86-76
       Los Angeles Angels: 85-77
         New York Mets: 70-92
    Chicago Cubs: 103-59
        Colorado Rockies: 69-93
      Cincinnati Reds: 64-98
     Arizona Diamondbacks: 69-93
       Boston Red Sox: 91-71
       San Francisco Giants: 82-80
         Los Angeles Dodgers: 91-71
    Washington Nationals: 97-65
         Detroit Tigers: 50-112
        Chicago White Sox: 67-95
       Cleveland Indians: 102-60
       New York Yankees: 84-78
     Philadelphia Phillies: 81-81
          San Diego Padres: 68-94
    Baltimore Orioles: 74-88
      St. Louis Cardinals: 86-76
        Arizona Diamondbacks: 69-93
       Los Angeles Angels: 85-77
         Minnesota Twins: 83-79
     Toronto Blue Jays: 73-89
    San Francisco Giants: 82-80
       New York Mets: 70-92
     Cincinnati Reds: 64-98
         Chicago Cubs: 103-59
    Milwaukee Brewers: 74-88
        Kansas City Royals: 97-65
      Oakland Athletics: 74-88
     Houston Astros: 101-61
         Tampa Bay Rays: 68-94
    Cleveland Indians: 102-60
    Los Angeles Dodgers: 91-71
       Arizona Diamondbacks: 69-93
        St. Louis Cardinals: 86-76
       New York Mets: 70-92
     Philadelphia Phillies: 81-81
         Boston Red Sox: 91-71
        Pittsburgh Pirates: 69-93
    Los Angeles Angels: 85-77
      Colorado Rockies: 69-93
       Chicago White Sox: 67-95
        Detroit Tigers: 50-112
     Minnesota Twins: 83-79
       Baltimore Orioles: 74-88
         Seattle Mariners: 96-66
    Boston Red Sox: 91-71
      New York Yankees: 84-78
     Washington Nationals: 97-65
        Kansas City Royals: 97-65
       Tampa Bay Rays: 68-94
"""
    teams_list = re.findall(r'(.*) (.*?)', data)
    for team_name in teams_list:
        season.add_team(team_name[0], Team(team_name[0]))
    parse_season_data(data)

season = Season()
main(data)

for team in season.teams.values():
    print(f"Name: {team.name}, Wins: {team.wins}, Losses: {team.losses}, Ties: {team.ties}")

This script will create teams and update their win-loss records based on the data provided. The final standings can be printed out by calling the get_standings method on the season object.

Please note that this is a simplified version of the script, it assumes that the input data is well formatted and does not handle errors. In a real-world application, you would want to add more error checking and handling code. Updated: June 27, 2025 at 12:10 AM