roclark / sportsipy

A free sports API written for python
MIT License
475 stars 189 forks source link

NFL teams proper abbreviations are not all properly working to pull data #765

Open mauldin123 opened 1 year ago

mauldin123 commented 1 year ago

Describe the bug I was trying to get the full city and names of the AFC West NFL teams. I used .name using the proper teams abbreviations such as 'KAN'. For KAN it successfully returned Kansas City Chiefs, and for DEN it successfully returned Denver Broncos.

That being said, when I used 'LAC' and 'LVR' for the Chargers and Raiders, I was presented with the same essential error for each - KeyError: 'LAC' for the chargers and KeyError: 'LVR' for the Raiders

To Reproduce `from sportsipy.nfl.teams import Team

teamName1 = Team('KAN') print(teamName1.name)

teamName2 = Team('DEN') print(teamName2.name)

teamName3 = Team('LVR') print(teamName3.name)

teamName4 = Team('LAC') print(teamName4.name)`

Expected behavior For LAC I was expecting Los Angeles Chargers to be returned. For LVR I was expecting Las Vegas Raiders to be returned.

Screenshots and Links Link showing all the abbreviations uses by sports-reference. https://www.pro-football-reference.com/?hstc=213859787.2ee56ab6f3498e72bacdf9b5c2a54b3f.1669855801055.1669862008924.1669864536323.3&hssc=213859787.2.1669864536323&__hsfp=3007689586

Image showing AFC West proper abbreviations Screenshot 2022-11-30 215208

Desktop:

Additional context I also noticed that the Los Angeles Rams and the Houston Texans common place abbreviations were not working either. It seems to be that the abbreviation needed is not the one listed on their website or any other website for that matter. That being said I know JAX works and returns Jacksonville Jaguars.

seanofthedead86 commented 1 year ago

Off the top of my head the Chargers abbreviation is SDG and he Raiders is RAI.

SKCwillie commented 1 year ago
from sportsipy.nflteams import Teams

teams = Teams()
fro team in teams:
    print(team.abbreviation, team.name)

This should give you a list of valid abbreviations.