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:

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

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

  • Adding documentation
  • Support for SmiteAPI (support Smite endpoint URL)
    • Support for Teams
      • Support for getteamdetails endpoint
      • Support for getteamplayers endpoint
      • Support for searchteams endpoint
  • (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.

Source Distribution

aRez-0.2.2.tar.gz (73.7 kB view details)

Uploaded Source

Built Distribution

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

aRez-0.2.2-py3-none-any.whl (88.7 kB view details)

Uploaded Python 3

File details

Details for the file aRez-0.2.2.tar.gz.

File metadata

  • Download URL: aRez-0.2.2.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.8

File hashes

Hashes for aRez-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f60d76e21644f6903a36887e72b4ee85acd9657811a7d94e19e84848a3084377
MD5 c2b3bd9ef15f86009a29aefe3a2eebc2
BLAKE2b-256 8f84c531040e794ff2bab40f58ea2c5c65cf71f19d5d5e12e21a6e4eba1972db

See more details on using hashes here.

File details

Details for the file aRez-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: aRez-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 88.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.8

File hashes

Hashes for aRez-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 25b711ce37faf9d17c07f4274e7d754454cf14f3ee73a793cacf126aa18ed127
MD5 387bde3bb5f17898ef13f83b0380a503
BLAKE2b-256 2887b4de4632a1ce8ab0e95cc35bfecc4f3b9c8bbcc0674f31be37d111a37659

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