Skip to main content

Async Python HiRez API wrapper

Project description

Async Python HiRez API wrapper

This project was created to simplify access to the API, as well as incorporate some data pre-processing and consistency. I am aware that PyRez already exists, however this project aims to do couple of things differently:

  • It's entirely async from the ground up, built using 'aiohttp'
  • Uses modern objective programming approach
  • Utilizes a local data cache to return data-rich objects

This library is supposed to be used as a module. As of right now, only PaladinsAPI is supported. Smite support is planned - please read below.

Currently supported:

  • <input type="checkbox" checked="" disabled="" /> getgods / getchampions and getitems regarding god / champion and card / talent / shop item information
  • <input type="checkbox" checked="" disabled="" /> getplayer (Player stats)
  • <input type="checkbox" checked="" disabled="" /> getplayerbatch (Multiple player stats at once)
  • <input type="checkbox" checked="" disabled="" /> getplayeridbyname, getplayeridsbygamertag and searchplayers under a single, intuitive method (Finding the players)
  • <input type="checkbox" checked="" disabled="" /> getfriends (Player friends)
  • <input type="checkbox" checked="" disabled="" /> getgodranks / getchampionranks (God / Champion stats)
  • <input type="checkbox" checked="" disabled="" /> getplayerloadouts (Player loadouts for each god / champion)
  • <input type="checkbox" checked="" disabled="" /> getplayerstatus (Player status)
  • <input type="checkbox" checked="" disabled="" /> getmatchhistory (Player's recent matches)
  • <input type="checkbox" checked="" disabled="" /> getmatchdetails (Match details, by the ID or from player's recent matches)
  • <input type="checkbox" checked="" disabled="" /> getplayeridbyportaluserid (Finding the player by their Portal ID)
  • <input type="checkbox" checked="" disabled="" /> getmatchplayerdetails (Information about the current player's match)
  • <input type="checkbox" disabled="" /> getplayerachievements (Player overall match stats)
  • <input type="checkbox" checked="" disabled="" /> getmatchdetailsbatch (Fetching multiple matches at once)
  • <input type="checkbox" checked="" disabled="" /> getmatchidsbyqueue (Fetching all matches by queue)
  • <input type="checkbox" checked="" disabled="" /> getqueuestats (Player match stats by queue)

There are plans on expanding the existing framework to incorporate the above and below:

  • <input type="checkbox" checked="" disabled="" /> Adding documentation
  • <input type="checkbox" disabled="" /> Support for SmiteAPI (support Smite endpoint URL)
    • <input type="checkbox" disabled="" /> Support for Teams - [ ] Support for getteamdetails endpoint - [ ] Support for getteamplayers endpoint - [ ] Support for searchteams endpoint
  • <input type="checkbox" disabled="" /> (Maybe) Support for RealmRoyaleAPI (support Realm Royale endpoint URL)

If you have some experience with Smite and it's API, and would be interested in working with me together on expanding this project, please don't hessitate to contact me (you can find contact information below).

Requirements

  • Python 3.8+
  • aiohttp 2.0+

Resources

Usage

Please see example.py for more examples.

import asyncio

import arez  # import the wrapper

DEV_ID = 1234  # your Developer ID (example)
AUTH_KEY = "L2U3M60A03662R24UKOMY0FIT4S2IBKU"  # your Auth Key (example)

async def main():
    # create an API instance
    api = arez.PaladinsAPI(DEV_ID, AUTH_KEY)
    # fetch Player stats
    player = await api.get_player(5959045)
    # display your rank
    print(player.ranked_best.rank.name)
    # close the API once you're done with it
    await api.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())  # run the async loop

Support

Buy me a coffee Support me on Patreon

Contact

Reddit: https://www.reddit.com/u/DevilXD

Discord: DevilXD#4437

Notes

This is an alpha version - as of right now, everything is a subject to change. Once both Paladins and Smite (and maybe Realm Royale) APIs are supported, this wrapper is going to have it's v1.0 release, and I will try to manage the versioning the proper way from there.

Project details


Download files

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

Files for aRez, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size aRez-0.2.2-py3-none-any.whl (88.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aRez-0.2.2.tar.gz (73.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page