Closed geoffbeier closed 1 month ago
Is this something you'd be interested in fixing?
I'm on the fence about what I'm going to do. I could:
Obviously, (2) is easiest, but if you're interested in accepting a contribution along the lines of (1) or (3) I might be inclined to put something together.
so i used the headers to have the right fields be populated for the object let me know if you have any other issues
Version Number
0.2.7
Describe the Bug
The API being used (at least for standings, but probably not only for standings) appears to be an internal/private API. Whether or not that's exactly the case, it's not stable across leagues.
For example, if I attempt to read my league's standings:
I get:
whereas it works for the league in
test.py
As the exception suggests, the problem is that the
Record
class expects the third item in thedata
array to have acontent
value that is an integral number of points, but with the league config in the one I was testing, the third item in that array is a float representing the team's winning percentage.This could be reasonably solved in one of two ways:
Use the fantrax public API instead. FantraxAPI_v1.pdf It provides less information but seems quite stable.
Use the headers sent down in the other API to determine field presence/order. So, for example, in my error case, I get:
before the rows.
Those keys could be used when assigning to fields as the response is being processed to avoid the problem I saw.