pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

team_pitching function cannot get relief pitching stats

Open fibsussy opened this issue 3 years ago • 0 comments

Hey! I was needing to get access to fan graphs team relief pitching sheet through your package but it just was not letting me.

I looked into it and created my own temporary fix on my install.

In order to get into the relief pitching section, you need to give this parameter in your request payload: ?stats=REL

The issue is in fangraphs.py under "def fetch" there isnt a good way to insert custom requests for the "stats" parameter in url_options.

In order to get the relief pitching, it needs to have 'stats': 'REL' but the closest thing you can do is make the parameter stats_columns in the fetch parameters 'REL' but then it rejects that input through some enum

I am not gonna look too much into it, I just deleted the code that was giving the error and made a way to insert 'REL' optionally through an extra parameter in fetch

Here is the fangraphs page I was attempting to fetch fangraphs.com

If anyone could show me what I am doing wrong OR confirm this is an issue as I see, please lmk

Thanks yall for the best!

image

fibsussy avatar Jun 08 '22 19:06 fibsussy