AIOWPI
aiohttp based world of warship api
aiowpi
is an asynchronous Python library for interacting with the World of Warships API. It simplifies making API calls to fetch player and warship data across different regions.
Features
- Async support for making efficient API requests
- Easy-to-use interface for fetching player and ship information
- Supports multiple World of Warships servers (NA, EU, ASIA, RU(maybe))
- Support reatelimter
Installation
You can install aiowpi
via pip:
pip install aiowpi
Quick start
Below is an example of how to use aiowpi to search player id use nick name:
import asyncio
from aiowpi import WPIClient, WOWS_ASIA
async def main():
wows_api = WPIClient(
application_id = "your_application_id",
max_rate=10,
rate_time_period=1,
)
player_info = await wows_api.player.search(WOWS_ASIA, "your nick name")
print(player_info)
asyncio.run(main())
Dynamic types
Below is an example of how to use aiowpi to fetch player information:
import asyncio
from aiowpi import WPIClient, WOWS_ASIA
async def main():
wows_api = WPIClient(application_id = "your_application_id")
player_info = await wows_api.player.person_data(WOWS_ASIA, 123456)
print(player_info)
asyncio.run(main())
But some time you may want get more than one user
import asyncio
from aiowpi import WPIClient, WOWS_ASIA
async def main():
wows_api = WPIClient(application_id = "your_application_id")
player_info = await wows_api.player.person_data(WOWS_ASIA, (123, 456, 789))
print(player_info)
asyncio.run(main())