Warships.py
A Python3 World of Warships API wrapper
Installation instruction:
pip install wowspy
Please consult the official documentation here
Example usage:
from wowspy import Wows
def example():
api_key = 'YOUR_WOWS_API_KEY'
my_api = Wows(api_key)
player_name = 'PotatoSquad'
player_id_response = my_api.players(
my_api.region.NA, player_name, fields='account_id', limit=1)
player_id = player_id_response['data'][0]['account_id']
player_stats_response = my_api.player_personal_data(
my_api.region.NA, player_id, fields='statistics.pvp')
print(player_stats_response)
if __name__ == '__main__':
example()
Example usage(with Aiohttp):
from asyncio import get_event_loop
from aiohttp import ClientSession
from wowspy import WowsAsync
async def example():
api_key = 'YOUR_WOWS_API_KEY'
session = ClientSession()
my_api = WowsAsync(api_key, session)
player_name = 'PotatoSquad'
player_id_response = await my_api.players(
my_api.region.NA, player_name, fields='account_id', limit=1)
player_id = player_id_response['data'][0]['account_id']
player_stats_response = await my_api.player_personal_data(
my_api.region.NA, player_id, fields='statistics.pvp')
print(player_stats_response)
if __name__ == '__main__':
loop = get_event_loop()
loop.run_until_complete(example())
loop.close()