Skip to main content

An asynchronous wrapper for ow-api.com using aiohttp

Project description

pyowapi

pyowapi is an asynchronous wrapper around an unofficial Overwatch api (https://ow-api.com) using aiohttp.

Things have changed considerably from v2 to v3, make sure to update your code before upgrading.

Example usage

import pyowapi

# Both of these create an event loop for you for convenience. This will not work where an event loop already exists (like discord.py)

# For a single player
player = pyowapi.get_player("Jayne#1447")
print(player.success)
print(player.private)
print(player.competitive_tank)

# For multiple players
player_list = ["Jayne#1447", "Krusher#9999"]
players = pyowapi.get_player(player_list)
for single_player in players:
    print(player.competitive_tank.group)
    print(player.competitive_tank.tier)

# For different platforms
player = pyowapi.get_player("Krusher99", platform="psn") # platform can be pc, xbox, ps4 and nintendo-switch
print(player.competitive_tank)

# If the player name is from user input sometimes it can be capitalized wrong or use the wrong discriminator
# You can pass correct_player = True and if the player name is incorrect pyowapi will attempt to find the correct one
# The player object will then have original_player_name which is the previous battletag
player = pyowapi.get_player("jayne#1447", correct_player=True)
print(player.original_player_name) # jayne#1447
print(player.player_name) # Jayne#1447
print(player.success) # True


# If an event loop already exists you need to call get_player_async instead
player = await pyowapi.get_player_async("Jayne#1447")
print(player.private)
print(player.competitive_tank)

# A player has the following properties
print(player.player_name)  # The name of the Player (battletag or other)
print(player.original_player_name) # If a player name was corrected this is the misspelled version
print(player.success)  # If the request was successful
print(player.private)  # If the player profile is private
print(player.endorsement)  # The player endorsement level
print(player.competitive_tank.tier)  # Player Tank Tier (5-1)
print(player.competitive_tank.group)  # Player Tank Group (Bronze, Silver, Gold, Platinum, Diamond, Master, Grandmaster)
print(player.competitive_damage)  # Player Damage Rating (similar to Tank)
print(player.competitive_support)  # Player Support Rating (similar to Tank)
print(player.quickplay_stats)  # Dictionary containing all quickplay stats
print(player.quickplay_games_won)
print(player.competitive_stats)  # Dictionary containing all competitive stats
print(player.competitive_games_played)
print(player.competitive_games_won)

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

pyowapi-3.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyowapi-3.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pyowapi-3.0.0.tar.gz.

File metadata

  • Download URL: pyowapi-3.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pyowapi-3.0.0.tar.gz
Algorithm Hash digest
SHA256 1254fca0eb1d90572131109c7c294445021e237fa63290f53787f810a991f746
MD5 7a487d8eb01e37de818d212ee92457f4
BLAKE2b-256 400026996f1e631212eeff74a6c83030685c30309416fc2d1435ae32b67b3b19

See more details on using hashes here.

File details

Details for the file pyowapi-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyowapi-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pyowapi-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acc20919e6f329e08d21fb1cd884e8f6a30f58aa37f01671f5066f292ed44e70
MD5 6676327e31c2baf4cce8c323cbf4ce54
BLAKE2b-256 820f8aeba77a652b9383dadf80e50be78b78b0ed492b4e4464fb461540f79db6

See more details on using hashes here.

Supported by

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