toddrob99 / MLB-StatsAPI

Python wrapper for MLB Stats API
GNU General Public License v3.0
533 stars 100 forks source link

Attribute Error - Function: lookup_team #91

Closed Laneville closed 2 years ago

Laneville commented 2 years ago

Getting an error when running the lookup_team function. Looks like it's in the init py script on line 1221 where it's calling the latest_season function.

Screen Shot 2022-08-13 at 11 02 36 AM
toddrob99 commented 2 years ago

Oops! Will release fix shortly.

toddrob99 commented 2 years ago

Workaround: include sportIds parameter and set the value to "1" (string).

statsapi.lookup_team("chn", sportIds="1")

[{'id': 112,
  'name': 'Chicago Cubs',
  'teamCode': 'chn',
  'fileCode': 'chc',
  'teamName': 'Cubs',
  'locationName': 'Chicago',
  'shortName': 'Chi Cubs'}]
toddrob99 commented 2 years ago

Fixed in v1.5.1, should be available on pypi now.

Thanks for raising the issue, and sorry for the bonehead missed test case.

Laneville commented 2 years ago

that was quick :) no no I appreciate the quick fix! Love what you've created with this project