Metadata-Version: 1.1
Name: yahoo_fb_stat_analysis
Version: 1.7
Summary: Python module to allow for advanced statistical analysis
Home-page: https://github.com/KipFeher85/Fantasy-Baseball
Author: Kip Feher
Author-email: kipfeher85@gmail.com
License: MIT
Description: ================================================
        Yahoo Fantasy Baseball Statistic Analysis Module
        ================================================
        
        Python Module Usage
        -------------------
        
        ::
        
          In [1]: from yahoo_oauth import OAuth2
        
          In [2]: import yahoo_fantasy_api as yfa
        
          In [3]: import json
        
          In [4]: import statsapi
        
          In [5]: from yahoo_fb_stat_analysis import main as yfbsa
        
          In [6]: oauth = OAuth2(None, None, from_file='OAuth2.json')
          [2021-06-18 15:39:52,655 DEBUG] [yahoo_oauth.oauth.__init__] Checking
          [2021-06-18 15:39:52,656 DEBUG] [yahoo_oauth.oauth.token_is_valid] ELAPSED TIME : 3514.6330070495605
          [2021-06-18 15:39:52,656 DEBUG] [yahoo_oauth.oauth.token_is_valid] TOKEN IS STILL VALID
        
          In [7]: gm = yfa.Game(oauth, 'mlb')
        
          In [8]: leagueID = gm.league_ids(year=2021)[0]
          Out[8]: ['NNN.a.NNNN']
        
          In [9]: lg = gm.to_league(leagueID)
        
          In [10]: tm = lg.to_team(team_key=lg.team_key())
        
          In [11]: lgObj = League()
        
          In [12]: lgObj.getCurrentRoster()
          Out[12]:
          Hitter List:
          {'player_id': 9718, 'name': 'J.T. Realmuto', 'status': '', 'position_type': 'B', 'eligible_positions': ['C', 'Util'], 'selected_position': 'C'}
          {'player_id': 8967, 'name': 'Paul Goldschmidt', 'status': '', 'position_type': 'B', 'eligible_positions': ['1B', 'Util'], 'selected_position': '1B'}
          ....
          {'player_id': 10439, 'name': 'Eloy JimÃ©nez', 'status': 'IL60', 'position_type': 'B', 'eligible_positions': ['OF', 'Util', 'IL'], 'selected_position': 'IL'}
          Pitcher List:
          {'player_id': 11903, 'name': 'Luis Garcia', 'status': '', 'position_type': 'P', 'eligible_positions': ['SP', 'P'], 'selected_position': 'SP'}
          {'player_id': 9122, 'name': 'Trevor Bauer', 'status': '', 'position_type': 'P', 'eligible_positions': ['SP', 'P'], 'selected_position': 'SP'}
          ....
          {'player_id': 12205, 'name': 'Sammy Long', 'status': '', 'position_type': 'P', 'eligible_positions': ['RP', 'P'], 'selected_position': ''}
          Injured List:
          {'player_id': 11568, 'name': 'Jake Fraley', 'status': 'DTD', 'position_type': 'B', 'eligible_positions': ['OF', 'Util'], 'selected_position': 'OF'}
          {'player_id': 9606, 'name': 'Max Muncy', 'status': 'IL10', 'position_type': 'B', 'eligible_positions': ['1B', '2B', '3B', 'Util', 'IL'], 'selected_position': 'IL'}
          ....
          {'player_id': 10932, 'name': 'Sixto SÃ¡nchez', 'status': 'NA', 'position_type': 'P', 'eligible_positions': ['SP', 'P', 'NA'], 'selected_position': 'NA'}
        
          In [13]: lgObj.currentRosterStats('lastmonth')
          Out[13]:
          Your batters:
          Name: Jake Fraley PA: 83.0 wRC: 17.273 wRC/PA: 0.208 wOBA: 0.422 BABIP: 0.306 WAR: 0.3 wRC+: 100.44673175922586
          Name: Max Muncy PA: 244.0 wRC: 49.796 wRC/PA: 0.204 wOBA: 0.417 BABIP: 0.287 WAR: 0.8 wRC+: 97.19561995027043
          ....
          Name: Eloy JimÃ©nez PA: 0 wRC: -0.0 wRC/PA: 0.0 wOBA: 0.0 BABIP: 0.0 WAR: 0.0 wRC+: 0.0
          Your pitchers:
          Name: Sixto SÃ¡nchez GS: - IP: 0 BF: 0 BB%: 0.00 K%: 0.00 FIP: 0.00 ERA: - WHIP: - WAR: 0.0
          Name: Sammy Long GS: 2.0 IP: 9.0 BF: 34.0 BB%: 5.88 K%: 29.41 FIP: 1.58 ERA: 5.0 WHIP: 0.89 WAR: 0.3
          ....
          Name: Alek Manoah GS: 4.0 IP: 20.1 BF: 83.0 BB%: 9.64 K%: 25.30 FIP: 4.33 ERA: 2.66 WHIP: 1.08 WAR: 0.3
        
          In [14]: lgObj.teamDetails()
          Out[14]:
          [('team_key', 'team's key'), ('team_id', '10'), ('name', 'Vlad Jr for MVP'), ('url', 'team url'), ('team_logos', [{'team_logo': {'size': 'large', 'url': 'https://yahoofantasysports-res.cloudinary.com/image/upload/t_s192sq/fantasy-logos/44fd8e00d7bbf781b3b7b4ca468a4072986c485ee4f0b8cd083b47ad327c42e3.png'}}]), ('waiver_priority', 10), ('number_of_moves', '21'), ('number_of_trades', 0), ('roster_adds', {'coverage_type': 'week', 'coverage_value': 11, 'value': '1'}), ('league_scoring_type', 'head'), ('draft_position', 2), ('has_draft_grade', 0), ('managers', [{'manager': {'manager_id': '10', 'nickname': 'Mr. X', 'guid': 'B3QNT4MWWQDXZS3J7HDPCDPWVU', 'image_url': 'https://s.yimg.com/ag/images/default_user_profile_pic_64sq.jpg', 'felo_score': '658', 'felo_tier': 'silver'}}])]
          [('team_key', 'team's key'), ('team_id', '12'), ('name', 'Pirates Suck'), ('url', 'team url'), ('team_logos', [{'team_logo': {'size': 'large', 'url': 'https://s.yimg.com/cv/apiv2/default/mlb/mlb_4_s.png'}}]), ('waiver_priority', 12), ('number_of_moves', '16'), ('number_of_trades', 0), ('roster_adds', {'coverage_type': 'week', 'coverage_value': 11, 'value': '0'}), ('league_scoring_type', 'head'), ('draft_position', 3), ('has_draft_grade', 0), ('managers', [{'manager': {'manager_id': '12', 'nickname': 'Mr. Y', 'guid': 'JLUKFLTAHXRTWF46MW3YLFKE3E', 'image_url': 'https://s.yimg.com/ag/images/default_user_profile_pic_64sq.jpg', 'felo_score': '668', 'felo_tier': 'silver'}}])]
          ....
          [('team_key', 'team's key'), ('team_id', '2'), ('name', 'A Bunch of Dumboâ€™s'), ('url', 'team url'), ('team_logos', [{'team_logo': {'size': 'large', 'url': 'https://s.yimg.com/cv/apiv2/default/mlb/mlb_2.png'}}]), ('waiver_priority', 1), ('number_of_moves', '1'), ('number_of_trades', 0), ('roster_adds', {'coverage_type': 'week', 'coverage_value': 11, 'value': '0'}), ('league_scoring_type', 'head'), ('draft_position', 12), ('has_draft_grade', 0), ('managers', [{'manager': {'manager_id': '2', 'nickname': 'Mr. Z', 'guid': '7NIG4ZRBEELFHB43MOYUGCW3KU', 'image_url': 'https://s.yimg.com/ag/images/default_user_profile_pic_64sq.jpg', 'felo_score': '477', 'felo_tier': 'bronze'}}])]
        
          In [15]: lgObj.predictTeamDay()
          Out[15]:
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] URL: https://statsapi.mlb.com/api/{ver}/schedule
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] Found query param: sportId
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] Found query param: hydrate
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] path_params: {}
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] query_params: {'sportId': '1', 'hydrate': 'decisions,probablePitcher(note),linescore'}
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] Replacing {ver} with default: v1.
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] URL: https://statsapi.mlb.com/api/v1/schedule
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] Adding query parameter sportId=1
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] URL: https://statsapi.mlb.com/api/v1/schedule?sportId=1
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] Adding query parameter hydrate=decisions,probablePitcher(note),linescore
          [2021-06-18 16:19:48,422 DEBUG] [statsapi.__init__.get] URL: https://statsapi.mlb.com/api/v1/schedule?sportId=1&hydrate=decisions,probablePitcher(note),linescore
          Game 3: Houston Astros at Baltimore Orioles
          Pitcher Stats over the past month
          HP: Keegan Akin IP: 23.1 BF: 106.0 BB%: 12.26 K%: 20.75 FIP: 5.17 ERA: 6.56 WHIP: 1.71 K: 22.0 HR: 4.0
          Keegan Akin Note: Akin endured a strange start his last time out, allowing eight runs while stiking out seven over 5 2/3 innings against Cleveland. The rookie lefty pitched to a 2.63 ERA over his first three starts.
          AP: Jake Odorizzi IP: 22.1 BF: 84.0 BB%: 7.14 K%: 28.57 FIP: 2.95 ERA: 2.82 WHIP: 0.81 K: 24.0 HR: 2.0
          Jake Odorizzi Note: Jake Odorizzi opens the series at Camden Yards for the Astros. The right-hander is 3-3 with a 4.83 ERA in 10 career starts in Baltimore.
        
          Game 4: Cleveland Indians at Chicago Cubs
          Pitcher Stats over the past month
          HP: Adbert Alzolay IP: 18.1 BF: 82.0 BB%: 12.2 K%: 26.83 FIP: 4.68 ERA: 3.93 WHIP: 1.42 K: 22.0 HR: 3.0
          Adbert Alzolay Note: Alzolay is expected to be activated from the 10-day IL after dealing with a blister on his right middle finger. In the seven starts prior to the blister-impacted game on June 7, the righty had 41 strikeouts vs. six walks with a 2.95 ERA in 39 2/3 innings.
          AP: Aaron Civale IP: 29.2 BF: 119.0 BB%: 5.04 K%: 19.33 FIP: 4.95 ERA: 3.94 WHIP: 1.21 K: 23.0 HR: 6.0
          Aaron Civale Note: With Shane Bieber and Zach Plesac on the IL, Civale is the front man of the Indians' rotation. He will take the mound against the Cubs for the second time in his career. Civale's previous start vs. Chicago saw him allow just two runs over six innings.
        
          ....
          Game 8: Los Angeles Dodgers at San Diego Padres
          Pitcher Stats over the past month
          HP: Yu Darvish IP: 28.1 BF: 113.0 BB%: 7.96 K%: 30.09 FIP: 4.2 ERA: 4.13 WHIP: 0.99 K: 34.0 HR: 5.0
          Yu Darvish Note: The Padres won 11 of Darvish's first 12 starts, but they've now lost two straight. Still, Darvish was mostly sharp in those two outings. He's allowed just 59 hits while striking out 97 across 84 innings this season.
          AP: Julio Urias IP: 25.2 BF: 117.0 BB%: 8.55 K%: 21.37 FIP: 5.43 ERA: 6.31 WHIP: 1.68 K: 25.0 HR: 6.0
          Julio Urias Note: UrÃ­as has made eight career appearances (three starts) against San Diego, going 1-0 with a 2.08 ERA. This will be his first start against the Padres this season.
        
          In [16]: faBatters = lgObj.getBatters('lastmonth', 2)
          Out[16]: {'Albert Pujols': [63.0, 5.0, 16.667, 0.267, 0.283, 0.884, 0.376, 10.779, 0.0, 97.58016735667573, 0.171] .... }
        
          In [17]: lgObj.printBatters('lastmonth', faBatters)
          Out[17]:
          Name: Luis Torrens PA: 9.0 wRC: 3.835 wRC/PA: 0.426 wOBA: 0.693 BABIP: 0.333 wRC+: 127.42872648942306
          Name: Luis Rengifo PA: 4.0 wRC: 0.897 wRC/PA: 0.224 wOBA: 0.442 BABIP: 0.667 wRC+: 118.29968811199949
          Name: Tony Kemp PA: 85.0 wRC: 16.321 wRC/PA: 0.192 wOBA: 0.402 BABIP: 0.345 wRC+: 100.27186961063333
          Name: Kyle Lewis PA: 49.0 wRC: 7.359 wRC/PA: 0.15 wOBA: 0.35 BABIP: 0.345 wRC+: 100.0976742096935
          ....
          Name: Derek Fisher PA: 2.0 wRC: -0.263 wRC/PA: -0.132 wOBA: 0.0 BABIP: 0.0 wRC+: -5.554554043537899
        
          In [18]: goldy = lgObj.getBatter('season', 8967)
          Out[18]: {'Paul Goldschmidt': [284.0, 8.915, 24.806, 0.296, 0.248, 0.72, 0.315, 34.654, 0.9, 96.00683997825512, 0.122]}
        
          In [19]: takenPitchers = lgObj.getPitchers('lastmonth', 1)
          Out[19]: {'Trevor Bauer': [9122.0, 14.0, 88.2, 351.0, 8.26, 31.62, 3.77, 2.64, 0.95, 1.2, 111.0, 14.0]}
        
          In [20]: lgObj.printPitchers('lastmonth', takenPitchers)
          Out[20]:
          Name: Edwin DÃ­az GS: 10.0 IP: 9.2 BF: 35.0 BB%: 2.86 K%: 45.71 FIP: -0.02 ERA: 0.93 WHIP: 0.62
          Name: Jacob deGrom GS: 5.0 IP: 27.0 BF: 91.0 BB%: 1.10 K%: 50.55 FIP: 0.32 ERA: 0.33 WHIP: 0.37
          Name: Corbin Burnes GS: 5.0 IP: 29.0 BF: 118.0 BB%: 7.63 K%: 37.29 FIP: 1.58 ERA: 3.1 WHIP: 1.1
          Name: Kevin Gausman GS: 6.0 IP: 36.0 BF: 132.0 BB%: 5.30 K%: 33.33 FIP: 1.99 ERA: 1.0 WHIP: 0.67
          ....
          Name: Zac Gallen GS: 1.0 IP: 2.2 BF: 14.0 BB%: 7.14 K%: 21.43 FIP: 9.04 ERA: 13.5 WHIP: 1.88
        
          In [21]: bauer = lgObj.getPitcher('season', 9122)
          Out[21]: {'Trevor Bauer': [9122.0, 14.0, 88.2, 351.0, 8.26, 31.62, 3.77, 2.64, 0.95, 1.2, 111.0, 14.0]}
        
          In [22]: lgObj.getAllPlayers('season')
          Out[22]:
          All pitchers currently on your team:
          Name: Max Scherzer GS: 13.0 IP: 77.1 BF: 289.0 BB%: 5.19 K%: 35.99 FIP: 3.03 ERA: 2.21 WHIP: 0.81 WAR: 1.9
          Name: Kyle Gibson GS: 13.0 IP: 77.2 BF: 307.0 BB%: 7.17 K%: 19.87 FIP: 3.33 ERA: 2.09 WHIP: 1.03 WAR: 1.6
          Name: Daniel Bard GS: 26.0 IP: 28.0 BF: 126.0 BB%: 8.73 K%: 28.57 FIP: 3.35 ERA: 3.86 WHIP: 1.46 WAR: 0.4
          ....
          Name: Alek Manoah GS: 4.0 IP: 20.1 BF: 83.0 BB%: 9.64 K%: 25.30 FIP: 4.33 ERA: 2.66 WHIP: 1.08 WAR: 0.3
        
          All pitchers currently on teams:
          Name: Josh Hader GS: 28.0 IP: 27.2 BF: 103.0 BB%: 9.71 K%: 46.60 FIP: 0.71 ERA: 0.65 WHIP: 0.76 WAR: 1.2
          Name: Jacob deGrom GS: 11.0 IP: 67.0 BF: 232.0 BB%: 3.45 K%: 47.84 FIP: 0.76 ERA: 0.54 WHIP: 0.51 WAR: 3.8
          Name: Corbin Burnes GS: 11.0 IP: 63.1 BF: 246.0 BB%: 4.07 K%: 41.46 FIP: 0.98 ERA: 2.27 WHIP: 0.85 WAR: 3.4
          ....
          Name: Stephen Strasburg GS: 5.0 IP: 21.2 BF: 95.0 BB%: 14.74 K%: 22.11 FIP: 5.73 ERA: 4.57 WHIP: 1.38 WAR: 0.0
        
          All free-agent pitchers
          Name: Justin Miller GS: 1.0 IP: 0.2 BF: 2.0 BB%: 0.00 K%: 50.00 FIP: -6.87 ERA: 0.0 WHIP: 0.0 WAR: 0.0
          Name: Spencer Patton GS: 4.0 IP: 4.0 BF: 13.0 BB%: 0.00 K%: 46.15 FIP: 0.13 ERA: 0.0 WHIP: 0.25 WAR: 0.2
          Name: Seth Lugo GS: 6.0 IP: 7.2 BF: 30.0 BB%: 6.67 K%: 40.00 FIP: 0.63 ERA: 1.17 WHIP: 1.17 WAR: 0.3
          ....
          Name: Kyle Freeland GS: 5.0 IP: 20.2 BF: 106.0 BB%: 10.38 K%: 11.32 FIP: 9.67 ERA: 9.58 WHIP: 2.27 WAR: -0.5
        
          All batters currently on your team:
          Name: Jake Fraley PA: 83.0 wRC: 17.273 wRC/PA: 0.208 wOBA: 0.422 BABIP: 0.306 WAR: 0.3 wRC+: 100.44673175922586
          Name: Max Muncy PA: 244.0 wRC: 49.796 wRC/PA: 0.204 wOBA: 0.417 BABIP: 0.287 WAR: 0.8 wRC+: 97.19561995027043
          Name: Jose Altuve PA: 271.0 wRC: 47.894 wRC/PA: 0.177 wOBA: 0.383 BABIP: 0.294 WAR: 0.9 wRC+: 96.16579130136618
          ....
          Name: Eloy JimÃ©nez PA: 0 wRC: -0.0 wRC/PA: 0.0 wOBA: 0.0 BABIP: 0.0 WAR: 0.0 wRC+: 0.0
        
          All batters currently on teams:
          Name: Jake Fraley PA: 83.0 wRC: 17.273 wRC/PA: 0.208 wOBA: 0.422 BABIP: 0.306 WAR: 0.3 wRC+: 100.44673175922586
          Name: Matt Olson PA: 267.0 wRC: 54.06 wRC/PA: 0.202 wOBA: 0.415 BABIP: 0.291 WAR: 0.9 wRC+: 99.82064713639215
          Name: RamÃ³n Laureano PA: 210.0 wRC: 33.058 wRC/PA: 0.157 wOBA: 0.359 BABIP: 0.298 WAR: 0.7 wRC+: 99.71592739918019
          ....
          Name: Garrett Hampson PA: 241.0 wRC: 29.795 wRC/PA: 0.124 wOBA: 0.317 BABIP: 0.304 WAR: 0.8 wRC+: 79.39941787107149
        
          All free-agent batters:
          Name: Chad Pinder PA: 96.0 wRC: 12.873 wRC/PA: 0.134 wOBA: 0.33 BABIP: 0.339 WAR: 0.3 wRC+: 99.6995572763256
          Name: Mike Zunino PA: 162.0 wRC: 21.983 wRC/PA: 0.136 wOBA: 0.332 BABIP: 0.215 WAR: 0.5 wRC+: 99.65206371001915
          Name: Ty France PA: 254.0 wRC: 35.285 wRC/PA: 0.139 wOBA: 0.336 BABIP: 0.299 WAR: 0.8 wRC+: 99.630166860551
          ....
          Name: Derek Fisher PA: 2.0 wRC: -0.263 wRC/PA: -0.132 wOBA: 0.0 BABIP: 0.0 WAR: 0.0 wRC+: -5.554554043537899
        
          In [23]: lgObj.getPlayer("Jose Altuve", "season")
          Out[23]: Name: Jose Altuve PA: 289.0 wRC: 51.075 wRC/PA: 0.177 wOBA: 0.383 BABIP: 0.298 WAR: 0.9 wRC+: 96.15519892336707
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.7
