Open ccott235 opened 1 year ago
Hey, @ccott235. I think this is could be a nice functionality to add. If you're interested in contributing, I think the classes in the Fangraphs datasources file will help you see how to scrape from Fangraphs.
Thinking on the architecture ->
We could create an Enum class that includes each supported source of data and then add that as a parameter to the main functions of pybaseball project.
Based on that argument on each function we can redirect the workflow to the corresponding logic based on the source of data selected or expressed on the function.
In that way we can easily maintain the logic for scraping from each source of data separated but, not totally decoupled since there will be lot of logic shared dealed as CORE or COMMON when handling this workflow for each one of the supported source of data.
In this way we can keep the door open for any other source of data that could be included in the future without the headache of breaking the already working things.
That would definitely be huge code overhaul. I'm not opposed in theory, but in practice I'm not sure the gain is worth the effort - in most cases there's pretty good overlap in data between similar sources. An entire rewrite just to get blown saves seems like overkill. @BrayanMnz, if you want to take a stab at it, by all means go ahead, but I'd personally be more than happy with just a small contribution that's just an additional function.
I am going to take a stab at adding in a small contribution to add in a function for this!
Is it possible to add a condition to have the pitching_stats_range and batting_stats_range to pull stats from Fangraphs instead of Baseball Reference? Speaking specifically to pitching stats - for some reason baseball reference has nothing on blown saves, which makes finding save percentage impossible using a time range.