So it's 10 PM, I'm tired, I'm foaming at the mouth, and I'm stuck in hillbilly hell and my IQ is dropping by the second. I was developing a script for my clan (RDDT numbah one! PG numbah five!) last week which allows us to organize for WCL by seeing which clan member has what tank, what time they're available, what packages they have left to get, how much silver they need to grind, and spits it out into a Google Spreadsheet cuz I'm awesome like that. (Bits and pieces to be released to public, but not until /u/1em0nhead in /r/WorldOfTanksConsole makes me a mod). The thing is, there isn't an actual Python library that supports the Console API, or at least not one that makes a lick of sense when your ADHD meds wear off.

So I made one instead.

It sucks, I haven't fully documented it, I haven't written tests for it yet, but most importantly I haven't been able to release it for public opinion and feedback. I've taken my sleep meds and about to go to bed but I had an idea — which it's a bad time to have one — to go ahead and present it to you now so I can wake up and start my day by reading all the reasons why I suck at programming.

Enough shitposting. Let's get to it.

What in the name of sweet premium HESH are you talking about?

I made a Python package for accessing Wargaming's World of Tanks Console API. It's simply called

What can `wotconsole` do?

The package is designed for ease of use. It's in the infant stages with plenty of features that I want to implement, but for now it's a good starting place.

`wotconsole` defines every possible endpoint from player and clan searches to player statistics. (Yes, Tankopedia is included too.) It has every parameter defined and every method documented. Mandatory and optional parameters are defined with some containing default values. It will also join up your listings (e.g. player_id, tank_id) for filtering searches.

But that's nothing special

No, and you're darn right it was a waste of time to sit there for three days, bouncing back and forth between the API to copy-paste and getting distracted. So then I decided I wanted to get a little clever.

Responses from the API are converted into a class called WOTXResponse. This class is designed to be convenient for the developer in two ways:

The raw `requests` response from the API is saved The instance will behave in the same manner as your returned data fields

To demonstrate, let's say you wanted to get information on the T-34 and SU-85. When you request this from the Tankopedia, it's returned as nested dictionaries. If you're using the `requests` package to access the API, you'd have to convert the data to JSON (which creates a dictionary) and save it as a separate variable.

But what if the API returns an error code? Well then you'd have to do `r.raise_status()` and have a 'try-catch' statement or have your own 'if-else', then worry about type casting, accessing variables now that they're out of scope, blah blah blah. That's a lot to balance out and check.

Here's where `wotconsole` prettifies things: it's all-inclusive and ready to go.

What else?

Well... that's about it for now. I'm getting drowsy and need to sleep before my dad comes in and beats me with premium M53/M55 rounds a toaster. So here's what it cannot do yet that I want to add:

Local-sided value validation (can't submit negative values, text in `date` fields, etc.) A `session`-esque class that will remember consistent parameters (application_id, api_realm, language) Cutting large list searches (e.g. searching for 101 tanks when max limit is 100) into two and combining the results Iterating searches that involve `page_no` More cowbell

What can I do?

Please download it, test it, give constructive feedback, and maybe do some pull requests. I just want people to fiddle with it and tell me whether or not it's worth maintaining.

I'm mostly active on Reddit, so ping me at /u/KamikazeRusher where I'll include a subreddit post in /r/WorldOfTanksConsole.

Documentation is located at https://wotconsole.r...s.io/en/latest/

Edited by Kamakazi Rusher, 12 June 2017 - 04:15 PM.