When I run this simple script at the bottom I get an error you see below when I do not pass in a value for limit:
(.venv) D:\Workspace\Statbotics>python test_get_team_events.py
----------------------------------------------
get_team_events(team=254, limit=5)------------
[{'country': 'USA',
'district': None,
**...[Edited out for brevity]...**
'team': 254,
'team_name': 'The Cheesy Poofs',
'time': 1046926800,
'type': 'regional',
'week': 1,
'year': 2003}]
----------------------------------------------
get_team_events(team=254)---------------------
Traceback (most recent call last):
File "D:\Workspace\Statbotics\test_get_team_events.py", line 26, in <module>
pprint.pprint(sb.get_team_events(team=254))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\TestMongo\.venv\Lib\site-packages\statbotics\main.py", line 439, in get_team_events
return self._get_plural(url, fields)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\TestMongo\.venv\Lib\site-packages\statbotics\main.py", line 78, in _get_plural
return self._get_plural(url, fields, retry=retry + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\TestMongo\.venv\Lib\site-packages\statbotics\main.py", line 78, in _get_plural
return self._get_plural(url, fields, retry=retry + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Projects\TestMongo\.venv\Lib\site-packages\statbotics\main.py", line 79, in _get_plural
raise UserWarning("Invalid query: " + url)
UserWarning: Invalid query: /team_events?limit=0&offset=0&team=254&metric=year&ascending=True
import pprint
import statbotics
# Create a Statbotics object
sb = statbotics.Statbotics()
# Get the stats for Team 254 but limit it to 5
print("----------------------------------------------")
print("get_team_events(team=254, limit=5)------------")
pprint.pprint(sb.get_team_events(team=254, limit=5))
# Get the stats for Team 254 with NO limit specified
print("----------------------------------------------")
print("get_team_events(team=254)---------------------")
pprint.pprint(sb.get_team_events(team=254))
When I run this simple script at the bottom I get an error you see below when I do not pass in a value for limit:
This is the script:
Environment:
Win11 running Python 3.11.7 with statbotics 3.0.0 installed.