walsh06 / python_rugby

Python api for querying rugby data
18 stars 6 forks source link

Remove Spaces when Storing and searching stat dicts #35

Open walsh06 opened 5 years ago

walsh06 commented 5 years ago

Currently stat dicts are stored by their name in the original database which may take a space, eg "Penalties Conceded", "try assists".

self.matchStats[stat['name'].lower()] = float(stat['value'])

One of the issues is that sometimes the original name in the database shows up without the space meaning the user will not receive all results for a given statistic. These should be normalised to remove the spaces when reading from the database to store in a stats dict and remove spaces when the user calls functions such as Player.getStat() or Match.getStatForTeam()