Comments (1)
Looks like they saw this issue a little back but the fix didn't make it to the pip version yet: fd33a4f.
If you're using a virtual environment, you can just modify that same file in your installed version (VENV_PATH/lib/pythonXX/site-packages/sportsipy/nfl/roster.py
), or you can follow the instructions on the readme to install from source.
However, I still had a problem even with their solution.
If not using the _slim=True
option, player names were not correctly populated.
So when I was debugging this problem with something like:
from sportsipy.nfl.teams import Teams as NFL_Teams
teams = NFL_Teams()
for team in teams:
print(team.roster.__dict__)
My output was something like this:
{'_team': 'DAL', '_slim': False, '_coach': 'Mike McCarthy', '_players': [None (AnaeBr00), None (AngeBr00), None (ArmsDo00), None (BashTa00), None (BernFr01), None (BiadTy00), None (BohaQu00), None (BrowAn02), None (BrowKy00), None (BrowNo00), None (BuntIa00), None (BurtDe00), None (CanaMa00), None (ClemCo00), None (CollLa01), None (CoopAm00), None (CoxxJa00), None (CoylTy00), None (DiggTr00), None (ElliEz00), None (FaolAu00), None (FarnMa00), None (FehoSi00), None (GallNe00), None (GallMi00), None (GiffLu00), None (GolsCh00), None (GoodC.00), None (GregRa00), None (HajrLi00), None (HamiJu00), None (HardJa01), None (HillTr00), None (HookMa00), None (JarwBl00), None (JoseKe02), None (KamaAz01), None (KazeDa00), None (KearJa00), None (KnigBr01), None (LambCe00), None (LawrDe00), None (LewiJo01), None (MartZa00), None (McGoCo01), None (McKeSe01), None (McQuJa00), None (MukuIs00), None (NealKe01), None (NsekTy00), None (OdigOs00), None (ParsMi00), None (PollTo00), None (PresDa01), None (RalsNi00), None (RushCo00), None (SchuDa00), None (SmitIt00), None (SmitJa05), None (SmitTy00), None (SpriJe00), None (SteeTe01), None (ThomDa05), None (TurnMa00), None (UrbaBr00), None (VandLe00), None (WatkCa00), None (WillCo00), None (WilsCe01), None (WilsDo01), None (WrigNa00), None (ZuerGr00)]}
You can see that the player_ids are correct but all their names are missing (i.,e., None
); but if you dig into a player object it has all stats populated*.
So I added another change around those lines to populate the names also; I added player_instance._name = self._get_name(player)
after the Player instance is created in line 1876 of the same file.
This is obviously not the best solution, _name
was supposed to be set in _parse_player_information
, but it's a quick and dirty fix to get us unstuck :)
* '_most_recent_season'
wasn't set correctly in the one I checked:
>>> player
None (AdamMi21)
>>> player.__dict__
{'_most_recent_season': '2011', ..., '_player_id': 'AdamMi21', '_season': ['2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', 'Career'], ...}
from sportsipy.
Related Issues (20)
- NCAAB height returns None obeject
- HTTPError
- HTTPError: HTTP Error 429: Too Many Requests HOT 21
- NCAAB Boxscore losing_abbr, losing_name, winning_abbr, winning_name not populating HOT 3
- Game (goals_against) data returning "None"
- Add NFL scoring information to Boxscore HOT 1
- NHL Boxscore error
- NFL teams proper abbreviations are not all properly working to pull data HOT 2
- NHL Boxscore returning previous days data HOT 2
- Teams data not found for all sports HOT 2
- NCAAB Boxscore and Boxscores returning blank for valid inputs HOT 2
- Script running but no data returned HOT 7
- Cannot get past first example of tutorial
- Did sports reference completely change their site? HOT 10
- join() got an unexpected keyword argument 'closing_combiner' error HOT 1
- Active Branch with specified requirements installed not returning expected results. HOT 1
- NBA Schedule returning empty objects HOT 1
- NFL Boxscore Returning No Values HOT 9
- 'None' type being returned from valid Boxscore URI instantiation HOT 2
- NFL Team data not retrieving HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sportsipy.