def test_ncaaf_empty_page_returns_no_teams(self):
        flexmock(utils) \
            .should_receive('_no_data_found') \
            .once()
        flexmock(utils) \
            .should_receive('_get_stats_table') \
            .and_return(None)

        teams = Teams()

        assert len(teams) == 0
Esempio n. 2
0
    def setup_method(self, *args, **kwargs):
        self.results = {
            'abbreviation': 'PURDUE',
            'name': 'Purdue',
            'games': 13,
            'wins': 7,
            'losses': 6,
            'win_percentage': .538,
            'conference_wins': 4,
            'conference_losses': 5,
            'conference_win_percentage': .444,
            'points_per_game': 25.2,
            'points_against_per_game': 20.5,
            'strength_of_schedule': 6.21,
            'simple_rating_system': 9.74,
            'pass_completions': 22.5,
            'pass_attempts': 37.8,
            'pass_completion_percentage': 59.5,
            'pass_yards': 251.5,
            'interceptions': 0.8,
            'pass_touchdowns': 2.1,
            'rush_attempts': 34.4,
            'rush_yards': 151.5,
            'rush_yards_per_attempt': 4.4,
            'rush_touchdowns': 0.9,
            'plays': 72.2,
            'yards': 403.1,
            'turnovers': 1.3,
            'fumbles_lost': 0.5,
            'yards_per_play': 5.6,
            'pass_first_downs': 11.1,
            'rush_first_downs': 8.8,
            'first_downs_from_penalties': 1.8,
            'first_downs': 21.7,
            'penalties': 5.9,
            'yards_from_penalties': 50.6
        }
        self.schools = [
            'UCF', 'Memphis', 'Oklahoma', 'Oklahoma State', 'Arizona',
            'Ohio State', 'Penn State', 'Florida Atlantic', 'Ohio',
            'South Florida', 'Louisville', 'Arkansas State', 'SMU', 'Missouri',
            'Alabama', 'Toledo', 'Washington', 'Oregon', 'North Texas',
            'Georgia', 'Wake Forest', 'West Virginia', 'Texas Tech',
            'Notre Dame', 'Auburn', 'Louisiana-Monroe', 'Western Michigan',
            'Wisconsin', 'Texas Christian', 'Appalachian State',
            'Colorado State', 'Clemson', 'Ole Miss', 'Texas A&M', 'USC',
            'Boise State', 'UCLA', 'Stanford', 'Kansas State',
            'North Carolina State', 'Mississippi State', 'Arizona State',
            'Troy', 'Air Force', 'San Diego State', 'Army', 'Massachusetts',
            'Louisiana Tech', 'Navy', 'Washington State', 'Utah State',
            'Texas', 'Utah', 'New Mexico State', 'Tulsa', 'Iowa State',
            'Northwestern', 'Southern Mississippi', 'Miami (FL)',
            'Northern Illinois', 'Arkansas', 'Nevada-Las Vegas', 'Buffalo',
            'Central Michigan', 'Houston', 'Iowa', 'Louisiana', 'Nevada',
            'Virginia Tech', 'Georgia Tech', 'California', 'Florida State',
            'UAB', 'Tulane', 'Syracuse', 'LSU', 'Fresno State', 'Indiana',
            'Marshall', 'Duke', 'Colorado', 'Eastern Michigan',
            'North Carolina', 'Nebraska', 'Boston College',
            'Florida International', 'Kentucky', 'Middle Tennessee State',
            'Western Kentucky', 'Bowling Green State', 'Michigan', 'Purdue',
            'Temple', 'East Carolina', 'Vanderbilt', 'Michigan State',
            'Miami (OH)', 'Baylor', 'South Carolina', 'Maryland', 'Pitt',
            'Coastal Carolina', 'Connecticut', 'UTSA', 'Wyoming', 'Hawaii',
            'Virginia', 'Akron', 'Florida', 'Minnesota', 'Cincinnati', 'Idaho',
            'Georgia Southern', 'New Mexico', 'Old Dominion', 'Oregon State',
            'Georgia State', 'South Alabama', 'Tennessee', 'Kansas', 'Rutgers',
            'Ball State', 'Texas State', 'Brigham Young', 'Rice',
            'San Jose State', 'Illinois', 'Charlotte', 'Kent State', 'UTEP'
        ]
        flexmock(utils) \
            .should_receive('_todays_date') \
            .and_return(MockDateTime(YEAR, MONTH))

        self.teams = Teams()
    def setup_method(self, *args, **kwargs):
        self.results = {
            'conference': 'big-ten',
            'abbreviation': 'PURDUE',
            'name': 'Purdue',
            'games': 13,
            'wins': 7,
            'losses': 6,
            'win_percentage': .538,
            'conference_wins': 4,
            'conference_losses': 5,
            'conference_win_percentage': .444,
            'points_per_game': 25.2,
            'points_against_per_game': 20.5,
            'strength_of_schedule': 6.21,
            'simple_rating_system': 9.74,
            'pass_completions': 22.5,
            'pass_attempts': 37.8,
            'pass_completion_percentage': 59.5,
            'pass_yards': 251.5,
            'interceptions': 0.8,
            'pass_touchdowns': 2.1,
            'rush_attempts': 34.4,
            'rush_yards': 151.5,
            'rush_yards_per_attempt': 4.4,
            'rush_touchdowns': 0.9,
            'plays': 72.2,
            'yards': 403.1,
            'turnovers': 1.3,
            'fumbles_lost': 0.5,
            'yards_per_play': 5.6,
            'pass_first_downs': 11.1,
            'rush_first_downs': 8.8,
            'first_downs_from_penalties': 1.8,
            'first_downs': 21.7,
            'penalties': 5.9,
            'yards_from_penalties': 50.6,
            'opponents_pass_completions': 19.1,
            'opponents_pass_attempts': 33.6,
            'opponents_pass_completion_percentage': 56.8,
            'opponents_pass_yards': 242.5,
            'opponents_interceptions': 0.8,
            'opponents_pass_touchdowns': 1.6,
            'opponents_rush_attempts': 37.4,
            'opponents_rush_yards': 133.2,
            'opponents_rush_yards_per_attempt': 3.6,
            'opponents_rush_touchdowns': 0.8,
            'opponents_plays': 71.0,
            'opponents_yards': 375.8,
            'opponents_turnovers': 1.6,
            'opponents_fumbles_lost': 0.8,
            'opponents_yards_per_play': 5.3,
            'opponents_pass_first_downs': 10.6,
            'opponents_rush_first_downs': 6.8,
            'opponents_first_downs_from_penalties': 1.8,
            'opponents_first_downs': 19.2,
            'opponents_penalties': 6.9,
            'opponents_yards_from_penalties': 59.8
        }
        self.schools = [
            'UCF', 'Memphis', 'Oklahoma', 'Oklahoma State', 'Arizona',
            'Ohio State', 'Penn State', 'Florida Atlantic', 'Ohio',
            'South Florida', 'Louisville', 'Arkansas State', 'SMU', 'Missouri',
            'Alabama', 'Toledo', 'Washington', 'Oregon', 'North Texas',
            'Georgia', 'Wake Forest', 'West Virginia', 'Texas Tech',
            'Notre Dame', 'Auburn', 'Louisiana-Monroe', 'Western Michigan',
            'Wisconsin', 'Texas Christian', 'Appalachian State',
            'Colorado State', 'Clemson', 'Ole Miss', 'Texas A&M', 'USC',
            'Boise State', 'UCLA', 'Stanford', 'Kansas State',
            'North Carolina State', 'Mississippi State', 'Arizona State',
            'Troy', 'Air Force', 'San Diego State', 'Army', 'Massachusetts',
            'Louisiana Tech', 'Navy', 'Washington State', 'Utah State',
            'Texas', 'Utah', 'New Mexico State', 'Tulsa', 'Iowa State',
            'Northwestern', 'Southern Mississippi', 'Miami (FL)',
            'Northern Illinois', 'Arkansas', 'Nevada-Las Vegas', 'Buffalo',
            'Central Michigan', 'Houston', 'Iowa', 'Louisiana', 'Nevada',
            'Virginia Tech', 'Georgia Tech', 'California', 'Florida State',
            'UAB', 'Tulane', 'Syracuse', 'LSU', 'Fresno State', 'Indiana',
            'Marshall', 'Duke', 'Colorado', 'Eastern Michigan',
            'North Carolina', 'Nebraska', 'Boston College',
            'Florida International', 'Kentucky', 'Middle Tennessee State',
            'Western Kentucky', 'Bowling Green State', 'Michigan', 'Purdue',
            'Temple', 'East Carolina', 'Vanderbilt', 'Michigan State',
            'Miami (OH)', 'Baylor', 'South Carolina', 'Maryland', 'Pitt',
            'Coastal Carolina', 'Connecticut', 'UTSA', 'Wyoming', 'Hawaii',
            'Virginia', 'Akron', 'Florida', 'Minnesota', 'Cincinnati', 'Idaho',
            'Georgia Southern', 'New Mexico', 'Old Dominion', 'Oregon State',
            'Georgia State', 'South Alabama', 'Tennessee', 'Kansas', 'Rutgers',
            'Ball State', 'Texas State', 'Brigham Young', 'Rice',
            'San Jose State', 'Illinois', 'Charlotte', 'Kent State', 'UTEP'
        ]

        team_conference = {
            'florida-state': 'acc',
            'boston-college': 'acc',
            'clemson': 'acc',
            'north-carolina-state': 'acc',
            'syracuse': 'acc',
            'wake-forest': 'acc',
            'louisville': 'acc',
            'virginia-tech': 'acc',
            'duke': 'acc',
            'georgia-tech': 'acc',
            'pittsburgh': 'acc',
            'virginia': 'acc',
            'miami-fl': 'acc',
            'north-carolina': 'acc',
            'florida': 'sec',
            'georgia': 'sec',
            'kentucky': 'sec',
            'missouri': 'sec',
            'south-carolina': 'sec',
            'vanderbilt': 'sec',
            'tennessee': 'sec',
            'alabama': 'sec',
            'arkansas': 'sec',
            'auburn': 'sec',
            'louisiana-state': 'sec',
            'mississippi-state': 'sec',
            'mississippi': 'sec',
            'texas-am': 'sec',
            'buffalo': 'mac',
            'ohio': 'mac',
            'bowling-green-state': 'mac',
            'kent-state': 'mac',
            'miami-oh': 'mac',
            'akron': 'mac',
            'ball-state': 'mac',
            'eastern-michigan': 'mac',
            'toledo': 'mac',
            'central-michigan': 'mac',
            'northern-illinois': 'mac',
            'western-michigan': 'mac',
            'georgia-southern': 'sun-belt',
            'appalachian-state': 'sun-belt',
            'coastal-carolina': 'sun-belt',
            'arkansas-state': 'sun-belt',
            'georgia-state': 'sun-belt',
            'louisiana-lafayette': 'sun-belt',
            'louisiana-monroe': 'sun-belt',
            'south-alabama': 'sun-belt',
            'texas-state': 'sun-belt',
            'troy': 'sun-belt',
            'idaho': 'sun-belt',
            'baylor': 'big-12',
            'kansas-state': 'big-12',
            'oklahoma': 'big-12',
            'oklahoma-state': 'big-12',
            'texas-christian': 'big-12',
            'west-virginia': 'big-12',
            'kansas': 'big-12',
            'texas': 'big-12',
            'texas-tech': 'big-12',
            'iowa-state': 'big-12',
            'colorado-state': 'mwc',
            'air-force': 'mwc',
            'boise-state': 'mwc',
            'new-mexico': 'mwc',
            'wyoming': 'mwc',
            'utah-state': 'mwc',
            'hawaii': 'mwc',
            'fresno-state': 'mwc',
            'nevada': 'mwc',
            'nevada-las-vegas': 'mwc',
            'san-diego-state': 'mwc',
            'san-jose-state': 'mwc',
            'california': 'pac-12',
            'oregon': 'pac-12',
            'stanford': 'pac-12',
            'washington-state': 'pac-12',
            'oregon-state': 'pac-12',
            'washington': 'pac-12',
            'arizona-state': 'pac-12',
            'colorado': 'pac-12',
            'southern-california': 'pac-12',
            'utah': 'pac-12',
            'arizona': 'pac-12',
            'ucla': 'pac-12',
            'central-florida': 'american',
            'connecticut': 'american',
            'cincinnati': 'american',
            'south-florida': 'american',
            'east-carolina': 'american',
            'temple': 'american',
            'houston': 'american',
            'memphis': 'american',
            'tulsa': 'american',
            'navy': 'american',
            'southern-methodist': 'american',
            'tulane': 'american',
            'charlotte': 'cusa',
            'marshall': 'cusa',
            'florida-atlantic': 'cusa',
            'florida-international': 'cusa',
            'middle-tennessee-state': 'cusa',
            'old-dominion': 'cusa',
            'western-kentucky': 'cusa',
            'louisiana-tech': 'cusa',
            'north-texas': 'cusa',
            'southern-mississippi': 'cusa',
            'alabama-birmingham': 'cusa',
            'rice': 'cusa',
            'texas-el-paso': 'cusa',
            'texas-san-antonio': 'cusa',
            'liberty': 'independent',
            'massachusetts': 'independent',
            'new-mexico-state': 'independent',
            'brigham-young': 'independent',
            'notre-dame': 'independent',
            'army': 'independent',
            'indiana': 'big-ten',
            'maryland': 'big-ten',
            'michigan-state': 'big-ten',
            'ohio-state': 'big-ten',
            'penn-state': 'big-ten',
            'rutgers': 'big-ten',
            'michigan': 'big-ten',
            'northwestern': 'big-ten',
            'purdue': 'big-ten',
            'illinois': 'big-ten',
            'iowa': 'big-ten',
            'minnesota': 'big-ten',
            'wisconsin': 'big-ten',
            'nebraska': 'big-ten'
        }
        self.team_conference = team_conference

        flexmock(utils) \
            .should_receive('_todays_date') \
            .and_return(MockDateTime(YEAR, MONTH))
        flexmock(Conferences) \
            .should_receive('_find_conferences') \
            .and_return(None)
        flexmock(Conferences) \
            .should_receive('team_conference') \
            .and_return(team_conference)

        self.teams = Teams()
    def test_invalid_conference_returns_none(self, *args, **kwargs):
        team_conference = {
            'florida-state': 'acc',
            'boston-college': 'acc',
            'clemson': 'acc',
            'north-carolina-state': 'acc',
            'syracuse': 'acc',
            'wake-forest': 'acc',
            'louisville': 'acc',
            'virginia-tech': 'acc',
            'duke': 'acc',
            'georgia-tech': 'acc',
            'pittsburgh': 'acc',
            'virginia': 'acc',
            'miami-fl': 'acc',
            'north-carolina': 'acc',
            'florida': 'sec',
            'georgia': 'sec',
            'kentucky': 'sec',
            'missouri': 'sec',
            'south-carolina': 'sec',
            'vanderbilt': 'sec',
            'tennessee': 'sec',
            'alabama': 'sec',
            'arkansas': 'sec',
            'auburn': 'sec',
            'louisiana-state': 'sec',
            'mississippi-state': 'sec',
            'mississippi': 'sec',
            'texas-am': 'sec',
            'buffalo': 'mac',
            'ohio': 'mac',
            'bowling-green-state': 'mac',
            'kent-state': 'mac',
            'miami-oh': 'mac',
            'akron': 'mac',
            'ball-state': 'mac',
            'eastern-michigan': 'mac',
            'toledo': 'mac',
            'central-michigan': 'mac',
            'northern-illinois': 'mac',
            'western-michigan': 'mac',
            'georgia-southern': 'sun-belt',
            'appalachian-state': 'sun-belt',
            'coastal-carolina': 'sun-belt',
            'arkansas-state': 'sun-belt',
            'georgia-state': 'sun-belt',
            'louisiana-lafayette': 'sun-belt',
            'louisiana-monroe': 'sun-belt',
            'south-alabama': 'sun-belt',
            'texas-state': 'sun-belt',
            'troy': 'sun-belt',
            'idaho': 'sun-belt',
            'baylor': 'big-12',
            'kansas-state': 'big-12',
            'oklahoma': 'big-12',
            'oklahoma-state': 'big-12',
            'texas-christian': 'big-12',
            'west-virginia': 'big-12',
            'kansas': 'big-12',
            'texas': 'big-12',
            'texas-tech': 'big-12',
            'iowa-state': 'big-12',
            'colorado-state': 'mwc',
            'air-force': 'mwc',
            'boise-state': 'mwc',
            'new-mexico': 'mwc',
            'wyoming': 'mwc',
            'utah-state': 'mwc',
            'hawaii': 'mwc',
            'fresno-state': 'mwc',
            'nevada': 'mwc',
            'nevada-las-vegas': 'mwc',
            'san-diego-state': 'mwc',
            'san-jose-state': 'mwc',
            'california': 'pac-12',
            'oregon': 'pac-12',
            'stanford': 'pac-12',
            'washington-state': 'pac-12',
            'oregon-state': 'pac-12',
            'washington': 'pac-12',
            'arizona-state': 'pac-12',
            'colorado': 'pac-12',
            'southern-california': 'pac-12',
            'utah': 'pac-12',
            'arizona': 'pac-12',
            'ucla': 'pac-12',
            'central-florida': 'american',
            'connecticut': 'american',
            'cincinnati': 'american',
            'south-florida': 'american',
            'east-carolina': 'american',
            'temple': 'american',
            'houston': 'american',
            'memphis': 'american',
            'tulsa': 'american',
            'navy': 'american',
            'southern-methodist': 'american',
            'tulane': 'american',
            'charlotte': 'cusa',
            'marshall': 'cusa',
            'florida-atlantic': 'cusa',
            'florida-international': 'cusa',
            'middle-tennessee-state': 'cusa',
            'old-dominion': 'cusa',
            'western-kentucky': 'cusa',
            'louisiana-tech': 'cusa',
            'north-texas': 'cusa',
            'southern-mississippi': 'cusa',
            'alabama-birmingham': 'cusa',
            'rice': 'cusa',
            'texas-el-paso': 'cusa',
            'texas-san-antonio': 'cusa',
            'liberty': 'independent',
            'massachusetts': 'independent',
            'new-mexico-state': 'independent',
            'brigham-young': 'independent',
            'notre-dame': 'independent',
            'army': 'independent'
        }

        flexmock(utils) \
            .should_receive('_todays_date') \
            .and_return(MockDateTime(YEAR, MONTH))
        flexmock(Conferences) \
            .should_receive('_find_conferences') \
            .and_return(None)
        flexmock(Conferences) \
            .should_receive('team_conference') \
            .and_return(team_conference)

        big_ten_schools = [
            'indiana', 'maryland', 'michigan-state', 'ohio-state',
            'penn-state', 'rutgers', 'michigan', 'northwestern', 'purdue',
            'illinois', 'iowa', 'minnesota', 'wisconsin', 'nebraska'
        ]

        teams = Teams()

        for team in big_ten_schools:
            assert teams(team).conference is None
Esempio n. 5
0
    def test_teams_string_representation(self, *args, **kwargs):
        expected = """Clemson (CLEMSON)
North Carolina State (NORTH-CAROLINA-STATE)
Louisville (LOUISVILLE)
Wake Forest (WAKE-FOREST)
Boston College (BOSTON-COLLEGE)
Florida State (FLORIDA-STATE)
Syracuse (SYRACUSE)
Miami (FL) (MIAMI-FL)
Virginia Tech (VIRGINIA-TECH)
Georgia Tech (GEORGIA-TECH)
Duke (DUKE)
Pitt (PITTSBURGH)
Virginia (VIRGINIA)
North Carolina (NORTH-CAROLINA)
UCF (CENTRAL-FLORIDA)
South Florida (SOUTH-FLORIDA)
Temple (TEMPLE)
Cincinnati (CINCINNATI)
Connecticut (CONNECTICUT)
East Carolina (EAST-CAROLINA)
Memphis (MEMPHIS)
Houston (HOUSTON)
Navy (NAVY)
SMU (SOUTHERN-METHODIST)
Tulane (TULANE)
Tulsa (TULSA)
Oklahoma (OKLAHOMA)
Texas Christian (TEXAS-CHRISTIAN)
Oklahoma State (OKLAHOMA-STATE)
Iowa State (IOWA-STATE)
Kansas State (KANSAS-STATE)
Texas (TEXAS)
West Virginia (WEST-VIRGINIA)
Texas Tech (TEXAS-TECH)
Baylor (BAYLOR)
Kansas (KANSAS)
Ohio State (OHIO-STATE)
Penn State (PENN-STATE)
Michigan State (MICHIGAN-STATE)
Michigan (MICHIGAN)
Rutgers (RUTGERS)
Indiana (INDIANA)
Maryland (MARYLAND)
Wisconsin (WISCONSIN)
Northwestern (NORTHWESTERN)
Iowa (IOWA)
Purdue (PURDUE)
Nebraska (NEBRASKA)
Minnesota (MINNESOTA)
Illinois (ILLINOIS)
Florida Atlantic (FLORIDA-ATLANTIC)
Florida International (FLORIDA-INTERNATIONAL)
Marshall (MARSHALL)
Middle Tennessee State (MIDDLE-TENNESSEE-STATE)
Western Kentucky (WESTERN-KENTUCKY)
Old Dominion (OLD-DOMINION)
Charlotte (CHARLOTTE)
North Texas (NORTH-TEXAS)
Southern Mississippi (SOUTHERN-MISSISSIPPI)
UAB (ALABAMA-BIRMINGHAM)
Louisiana Tech (LOUISIANA-TECH)
UTSA (TEXAS-SAN-ANTONIO)
Rice (RICE)
UTEP (TEXAS-EL-PASO)
Massachusetts (MASSACHUSETTS)
Army (ARMY)
Notre Dame (NOTRE-DAME)
Brigham Young (BRIGHAM-YOUNG)
Akron (AKRON)
Ohio (OHIO)
Buffalo (BUFFALO)
Miami (OH) (MIAMI-OH)
Bowling Green State (BOWLING-GREEN-STATE)
Kent State (KENT-STATE)
Toledo (TOLEDO)
Central Michigan (CENTRAL-MICHIGAN)
Northern Illinois (NORTHERN-ILLINOIS)
Western Michigan (WESTERN-MICHIGAN)
Eastern Michigan (EASTERN-MICHIGAN)
Ball State (BALL-STATE)
Boise State (BOISE-STATE)
Wyoming (WYOMING)
Colorado State (COLORADO-STATE)
Air Force (AIR-FORCE)
Utah State (UTAH-STATE)
New Mexico (NEW-MEXICO)
Fresno State (FRESNO-STATE)
San Diego State (SAN-DIEGO-STATE)
Nevada-Las Vegas (NEVADA-LAS-VEGAS)
Nevada (NEVADA)
Hawaii (HAWAII)
San Jose State (SAN-JOSE-STATE)
Washington (WASHINGTON)
Stanford (STANFORD)
Washington State (WASHINGTON-STATE)
Oregon (OREGON)
California (CALIFORNIA)
Oregon State (OREGON-STATE)
USC (SOUTHERN-CALIFORNIA)
Arizona State (ARIZONA-STATE)
Arizona (ARIZONA)
UCLA (UCLA)
Utah (UTAH)
Colorado (COLORADO)
Georgia (GEORGIA)
South Carolina (SOUTH-CAROLINA)
Kentucky (KENTUCKY)
Missouri (MISSOURI)
Florida (FLORIDA)
Vanderbilt (VANDERBILT)
Tennessee (TENNESSEE)
Alabama (ALABAMA)
Auburn (AUBURN)
LSU (LOUISIANA-STATE)
Mississippi State (MISSISSIPPI-STATE)
Texas A&M (TEXAS-AM)
Ole Miss (MISSISSIPPI)
Arkansas (ARKANSAS)
Appalachian State (APPALACHIAN-STATE)
Coastal Carolina (COASTAL-CAROLINA)
Georgia Southern (GEORGIA-SOUTHERN)
Troy (TROY)
Arkansas State (ARKANSAS-STATE)
Georgia State (GEORGIA-STATE)
New Mexico State (NEW-MEXICO-STATE)
Louisiana (LOUISIANA-LAFAYETTE)
Louisiana-Monroe (LOUISIANA-MONROE)
Idaho (IDAHO)
South Alabama (SOUTH-ALABAMA)
Texas State (TEXAS-STATE)"""

        teams = Teams()

        assert teams.__repr__() == expected
Esempio n. 6
0
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(sys.path[0])))
from sportsreference.ncaaf.conferences import Conferences
from sportsreference.ncaaf.rankings import Rankings
from sportsreference.ncaaf.teams import Teams

for team in Teams():
    print(team.name)
    for player in team.roster.players:
        print(player.name)
    for game in team.schedule:
        print(game.dataframe)
        print(game.dataframe_extended)

conferences = Conferences()
print(conferences.conferences)
print(conferences.team_conference)

rankings = Rankings()
print(rankings.current)
print(rankings.current_extended)
print(rankings.complete)
Esempio n. 7
0
        return len(self.total)


def formatData(t, s):
    if not isinstance(t, dict) and not isinstance(t, list):
        print "\t" * s + str(t)
    else:
        for key in t:
            print "\t" * s + str(key)
            if not isinstance(t, list):
                formatData(t[key], s + 1)


team_trees = {}
team_losses = {}
teams = Teams(2019)
for team in teams:
    team_losses[team.abbreviation.lower()] = []
    for game in team.schedule:
        if game.result == "Loss":
            team_losses[team.abbreviation.lower()].append(game.opponent_abbr)

for team, losses in team_losses.items():
    tree = Tree(team)
    for loss in losses:
        tree.add_loss(loss)

    team_trees[team] = tree

print "MICHIGAN STATE:"
team_trees["michigan-state"].get_tree(team_losses)
Esempio n. 8
0
# purdue_schedule = Schedule('purdue')
# for game in purdue_schedule:
#     print(game.date)

summary_list = []

# for x in range(1990, 1995):
# season = str(1991)
# braves = Roster('ATL', season)
# pitchers = [player for player in braves.players if player.position == 'P']
# for pitcher in pitchers:
#     summary_list.append((pitcher.name, season, pitcher.position, pitcher(season).games, pitcher(season).era, pitcher(season).wins, pitcher(season).whip))

# print(summary_list)

# for x in range(2002, 2005):
teams = Teams(2003)

for team in teams:
    if team.abbreviation == 'NORTH-CAROLINA-STATE':
        print(team.abbreviation + " - " + str(team.wins) + " Rush yards: " +
              str(team.rush_yards))

# for x in range(1992, 2005):
#   teams = Teams(x)

#   for team in teams:
#     if team.abbreviation == 'ATL':
#       print(str(x) + ' - ' + team.abbreviation + " - " + str(team.wins) + " ERA: " + str(team.earned_runs_against) + " Pythag - " + team.pythagorean_win_loss)