Python library for accessing eRepublik API

Day 702, 09:12 Published in USA Croatia by FG Lexia


Hi,

I have just finished V1 of my Python access library for eAPI. It is incomplete, but since the code is quite clean, it is easy to extend and use.

The code itself is licensed under GNU General Public License v3 and everybody is free to reuse the code in any way he wishes (while not breaking the GPL, of course).

The code is located in one file which can be downloaded from pastebin here.



There are 2 sample implementations of that code. One of them being the program for managing eSerbian Ministry of Emigration which locates people (that are hopefully not multies and are ready to fight) in regions without Q5 hospitals. The code is prepared for eSerbia where there are 3 such regions, but can easily be customized for any other country (if you need help and would like to use that code, don't hesitate to send me a message and I'll help you out, possibly for a small fee 😛). That code is (oh how strange) also licensed under GNU General Public License v3 and can be downloaded from pastebin.



The other sample implementation if a bot called Domar that is being used on eSerbian IRC channels on mibbit, but I guess it can be easily used on other servers if needed (if it is for any reason incompatible with some server, just ask me to fix the bug). That bot supports the commands such as "!info", "!fight", "!link" and "!donate" which give basic info about a citizen, calculate dmg while fighting with various kinds of weapons with current and 100% wellness, gives profile and donate links. There are more commands, but read the code to see them (or ask me if you don't know how to read Python which I will find strange). The code (which is also GPLv3) can be found also on pastebin.

To run that bot, you also need 2 files from python-irclib - irclib.py and ircbot.py.



PS: I am writing in USA since it is currently biggest eCountry and Free software is mostly from there. I believe that I will get greatest coverage that way, but anybody is free to use this code, of course, be he the enemy or friend of my eCountry and/or country.