-
Unauthenticated APIs:
- Nation API
- Alliance API
- work still in progress
-
Authenticated APIs:
- none, work still in progress
- Easy to use
- Object oriented (take this with a grain of salt, it's my first OOP project xD)
- No need worry about Alex's inability to use correct typing 🙄
Built-in cache for better performance in non-time-critical APIsin progressSupports bothin progressrequests
andaiohttp
backends
PW4py 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)
- Use it!
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 :)