Releases: JacobLee23/FanGraphs-Export
File Hierarchy Refactor
File Hierarchy Refactor
Integrate fangraphs.leaders.*
modules into fangraphs.leaders.leaders
.
fangraphs.leaders.gamespan.GameSpan
=>fangraphs.leaders.leaders.GameSpan
fangraphs.leaders.international.International
=>fangraphs.leaders.leaders.International
fangraphs.leaders.majorleague.MajorLeague
=>fangraphs.leaders.leaders.MajorLeague
fangraphs.leaders.seasonstat.SeasonStatGrid
=>fangraphs.leaders.leaders.SeasonStat
fangraphs.leaders.splits.Splits
=>fangraphs.leaders.leaders.Splits
fangraphs.leaders.war.WAR
=>fangraphs.leaders.leaders.WAR
Bug Fixes
Bug Fixes
- Fix naming inconsistencies of package (
FanGraphs
=>fangraphs
) - Fix bug in
FanGraphs/tests/test_leaders
in theTestMajorLeague
setup
FanGraphs Leaders
FanGraphs Leaders
The webpages under the FanGraphs Leaders tab are covered by the FanGraphs.leaders
module.
Modules
FanGraphs.leaders
FanGraphs.leaders.GameSpan
: Web scraper for the FanGraphs 60-Game Span LeaderboardsFanGraphs.leaders.International
: Web scraper for the FanGraphs KBO LeaderboardsFanGraphs.leaders.MajorLeague
: Web scraper for the FanGraphs Major League LeaderboardsFanGraphs.leaders.SeasonStatGrid
: Web scraper for the FanGraphs Season Stat GridFanGraphs.leaders.Splits
: Web scraper for the FanGraphs Splits LeaderboardsFanGraphs.leaders.WAR
: Web scraper for the FanGraphs Combined WAR Leaderboards
FanGraphs.utilities
FanGraphs.utilities.ScrapingUtilities
: Manager for the web scraping objects used byFangraphs.leaders
FanGraphs.exceptions
FanGraphs.exceptions.FilterUpdateIncapability
FanGraphs.exceptions.InvalidFilterGroup
FanGraphs.exceptions.InvalidFilterOption
FanGraphs.exceptions.InvalidFilterQuery
FanGraphs.exceptions.InvalidQuickSplit
FanGraphs.exceptions.UnknownBrowser
FanGraphs.selectors.leaders_sel
FanGraphs.selectors.leaders_sel.GameSpan
: CSS selectors forFanGraphs.leaders.GameSpan
FanGraphs.selectors.leaders_sel.International
: CSS selectors forFanGraphs.leaders.International
FanGraphs.selectors.leaders_sel.MajorLeague
: CSS selectors forFanGraphs.leaders.MajorLeague
FanGraphs.selectors.leaders_sel.SeasonStatGrid
: CSS selectors forFanGraphs.leaders.SeasonStatGrid
FanGraphs.selectors.leaders_sel.Splits
: CSS selectors forFanGraphs.leaders.Splits
FanGraphs.selectors.leaders_sel.WAR
: CSS selectors forFanGraphs.leaders.WAR
International Leaderboards
International Leaderboards
The FanGraphs KBO Leaders is covered.
The page can be scraped with the InternationalLeaderboards
class of the FanGraphs.leaders
module.
from FanGraphs.leaders import InternationalLeaderboards
intl = InternationalLeaderboards()
intl.configure(query, option)
intl.export("InternationLeaderboards.csv")
intl.quit()
WAR Leaderboards
WAR Leaderboards
The FanGraphs WAR Leaderboards is covered.
This page can be scraped with the WARLeaderboards
class of the FanGraphs.leaders
module.
from FanGraphs import leaders
war = leaders.WARLeaderboards()
war.configure(query, option)
war.export("WARLeaderboards.csv")
war.quit()
Game Span Leaderboards
Game Span Leaderboards
The FanGraphs 60-Game Span Leaderboards is covered.
This page can be scraped by using the GameSpanLeaderboards
class in the FanGraphs.leaders
module.
from FanGraphs.leaders import GameSpanLeaderboards
gsl = GameSpanLeaderboards()
gsl.configure(query, value)
gsl.export(path="GameSpanLeaderboards.csv")
gsl.quit()
Splits Leaderboards
Splits Leaderboards
The FanGraphs Splits Leaderboards is covered.
This page can be scraped using the SplitsLeaderboards
class of the FanGraphs.leaders
module.
from FanGraphs.leaders import SplitsLeaderboards
splits = SplitsLeaderboards()
splits.configure(query, value)
splits.export(path="SplitsLeaderboards.csv")
splits.quit()
Pytest Refactor
Pytest Refactor
The unit tests were refactored to use pytest
(docs) over unittest
and are now treated like a package nested in FanGraphs
(FanGraphs.tests
).
FanGraphs/tests:
- __init__.py
- test_leaders.py
The functional tests were temporarily relocated to FanGraphs
as a package, but were then integrated into the unit tests.
Playwright Refactor
Playwright Refactor
Using selenium
as an automated browser was somewhat slow and produced inconsistent results. Thus, the codebase was refactored to utilize playwright
(docs).
The usage and functionality of all the modules remains the same.
Season Stat Grid
Season Stat Grid
The FanGraphs Season Stat Grid is covered.
This page can be scraped using SeasonStatGrid
class of the FanGraphs.leaders
module.
from FanGraphs.leaders import SeasonStatGrid
ssg = SeasonStatGrid()
ssg.configure(query, value)
ssg.export(name="SeasonStatGrid.csv")
ssg.quit()