Ranking
Is there a specific reason you need to do it in Python? I'm not even entirely sure you need to communicate with the server. If you're working on AI/machine learning in the game I think all you really need is move data which you can get via the Lua functions. If you're dead set on using Python you can still connect to the server (think like Telnet) and parse move data received by the server.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today