Politics & War API wrapper for Python
Unauthenticated APIs:
Authenticated APIs:
requests
and aiohttp
backendsPW4py is now on PyPI, so you can just install it by doing:
pip install pw4py
Load it:
import pw4py
# default
pw4py.init(key = "abcdef12345")
# use the test server
pw4py.load(test_server = True, key = "abcdef12345")
Init an object of the API you want to use:
from pw4py import Nation # so you don't have to type pw4py.Nation() every time
nation = Nation(id)
name = str(nation)
cityids = nation.cityids
color = nation.get("color")
# etc...
Feel free to make a new issue here if you find any bugs, encounter any problems, or have a feature suggestion.
If you know how to fix it or how to implement a new feature, please do! Fork the repo, and submit a pull request :)