Hi everyone,
I spent a day out to learn Python a bit (and am utterly disappointed by the lack of overloading methods, but eh.)
So I wrote a basic interface for TBA using their API and JSON parsing.
Right now, it can do the following things:
View all events this season (and their respective alliances for 1-8)
View a single team’s basic info.
View all teams on a TBA page (1-499, 500-999, etc.)
View all district codes and their respective names.
View district rankings & points.
With more features as I learn more / get requested!
Unfinished feature to automatically highlight a team in your district rank view.
To be worked on:
An entire python library for TBA calls… (v2 only likely)
OPR & rank manipulation (depending on what I get around to doing…)
Data output (hopefully)
Again, the whole project is opensource, so feel free to contribute!
(Side note, this only properly works in Python 2.7 because of input() vs raw_input(). If anyone has a solution that works in both, I’d happily accept…)
An alternative, more sophisticated approach would be to check the Python version in your function. This Stack Overflow thread talks about how to use the Python version number in a program.
A similar method can be used for print() vs the print keyword, which should make it compatible with both Python 2.7 and 3.X.