Skip to main content

Async Python client for the World of Warships API.

Project description

AIOWPI

aiohttp based world of warship api

中文说明

Python 3.8 GitHub file size in bytes PyPI License

PyPI - Downloads View

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():
    # Get from wg api full guid
    # Server applications. Request limit per second is set to 20 requests per second.
    # Standalone applications. The limit is set on the number of requests sent from one IP address at the same time and in general equal to 10 requests per second.
    wows_api = WPIClient(
                application_id = "your_application_id",
                max_rate=10,
                rate_time_period=1,
    )
    
    # Search for a player on the Asia server
    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")
    
    # get a player info on the Asia server
    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")
    
    # get players info on the Asia server
    player_info = await wows_api.player.person_data(WOWS_ASIA, (123, 456, 789))
    print(player_info)
asyncio.run(main())

reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiowpi-0.1.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

aiowpi-0.1.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file aiowpi-0.1.2.tar.gz.

File metadata

  • Download URL: aiowpi-0.1.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for aiowpi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 568b4ee0a0ff1a0271e12c626351e03b02c56436a7f466d92e75dc5d3ba71408
MD5 a553418a979225d61c2ab14c36f4e80d
BLAKE2b-256 30015c11400ee74d3c5fefb72963344c058d3e079c9fe02d095c4a305d78900d

See more details on using hashes here.

File details

Details for the file aiowpi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aiowpi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for aiowpi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 930aad99dfbec55a56040c7731d8a11a2849ef3d8f22045a3057f8c99d7343d3
MD5 79cfbece9a9c71fd7221b882b0fddcf5
BLAKE2b-256 6de3e9c5df6062b0ba1232e22b9b3d850c55201c10b3fd1c34f3d078bbca5b31

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page