Skip to main content

RaidToolkit Client

This package provides access to the Raid Toolkit API

Installation

pip3 install raidtoolkit

Usage

To access APIs from RTK, use the RaidToolkitClient class to connect and read account information.

import asyncio
from raidtoolkit import RaidToolkitClient

async def main():
    client = RaidToolkitClient()
    client.connect()
    try:
        accounts = await client.get_connected_accounts()
        for account in accounts:
            print(f'Account: {account.name}')
            
            viewInfo = await account.get_current_view_info()
            print(f'\tCurrent View: {viewInfo["viewKey"]} ({viewInfo["viewId"]})')
            
            lastBattleResponse = await account.get_last_battle_response()
            print(f'\tLast Battle Response: {lastBattleResponse["turnCount"]} turns')

            heroes = await account.get_heroes()
            nLegendary = len(list(filter(lambda hero: hero["type"]["rarity"] == 'Legendary', heroes)))
            print(f'\tHero count: {len(heroes)} ({nLegendary} legendary)')

    finally:
        # make sure to always close the client, or the python process will continue to run until the client is closed.
        client.close()

if __name__ == "__main__":
    asyncio.run(main())

APIs

RaidToolkitClient

Properties

StaticDataApi

Provides access to the raw StaticDataApi API.

AccountApi

NOTE: All functions in the AccountApi are also available on the Account object returned from get_*_accounts APIs on the RaidToolkitClient class.

Provides access to the raw AccountApi API.

RealtimeApi

NOTE: All functions in the RealtimeApi are also available on the Account object returned from get_*_accounts APIs on the RaidToolkitClient class.

Provides access to the raw RealtimeApi API.

Methods

get_all_accounts()

Gets a list of Account which RTK has saved data for. Not all accounts may have a game client running.

accounts = client.get_all_accounts()
for account in accounts:
    print(f'Account: {account.name}')

get_connected_accounts()

Gets a list of Account which RTK has saved data for, and have a game client running.

accounts = client.get_connected_accounts()
for account in accounts:
    print(f'Account: {account.name}')

StaticDataApi

Methods

get_all_data()

Gets all static data from RTK.

data = client.StaticDataApi.get_all_data()
print(data)
get_localized_strings()

Gets all localized strings from RTK.

strings = client.StaticDataApi.get_localized_strings()
print(strings["l10n:skill/description?id=57203#static"]) # "Increases the damage inflicted by this Champion equal to the percentage of MAX HP destroyed on the target."
get_arena_data()

Gets all arena data from RTK.

arena_data = client.StaticDataApi.get_arena_data()
print(arena_data)
get_artifact_data()

Gets all artifact data from RTK.

artifact_data = client.StaticDataApi.get_artifact_data()
print(artifact_data)
get_hero_data()

Gets all hero data from RTK.

hero_data = client.StaticDataApi.get_hero_data()
print(hero_data)
get_skill_data()

Gets all skill data from RTK.

skill_data = client.StaticDataApi.get_skill_data()
print(skill_data)
get_stage_data()

Gets all stage data from RTK.

stage_data = client.StaticDataApi.get_stage_data()
print(stage_data)

Account

Object which represents a single account in RTK. Account may or may not be connected

Methods

get_dump()

Gets a dump of the account in RaidExtractor format.

dump = account.get_dump()
print(dump)

get_artifacts()

Gets a list of artifacts for the account.

artifacts = account.get_artifacts()
for artifact in artifacts:
    print(f'Artifact: {artifact}') # don't actually do this lol

get_heroes(snapshot: bool)

Gets a list of heroes for the account.

strings = client.StaticDataApi.get_localized_strings()
heroes = account.get_heroes()
for hero in heroes:
    print(f'Hero #{hero["id"]}: {strings[hero["type"]["name"]["key"]]}')

get_resources()

Gets a list of resources for the account.

resources = account.get_resources()
print(resources)

get_resources()

Gets a list of resources for the account.

resources = account.get_resources()
print(resources)

get_academy()

Gets the faction guardian information for the account.

academy = account.get_academy()
print(academy)

get_last_battle_response()

Gets the last battle response for the account.

last_battle_response = account.get_last_battle_response()
print(last_battle_response)

get_current_view_info()

Gets the current view info for the account.

current_view_info = account.get_current_view_info()
print(f'\tCurrent View: {current_view_info["viewKey"]} ({current_view_info["viewId"]})')

Release files for raidtoolkit 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raidtoolkit 0.2.1
File Size Uploaded
raidtoolkit-0.2.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raidtoolkit 0.2.1
File Interpreter ABI Platform
raidtoolkit-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / raidtoolkit-0.2.1.tar.gz

Download URL raidtoolkit-0.2.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f3f3c90061323c0825ad7a881cc47abacf02b0a91c7ff127351639c79dc7470d
BLAKE2b-256 checksum
How to use checksums
df81164c86dc440742379aa01437f96955bb9733e5f19f4baa64bae6a34580a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / raidtoolkit-0.2.1-py3-none-any.whl

Download URL raidtoolkit-0.2.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97bd7c5678367d9618ce1e63e94f045b2b86bf22e46ffbdd19ce54ff13509cf3
BLAKE2b-256 checksum
How to use checksums
fa6844435588a2bd4c55a3b9fcc9f320d94477c0a0f2691087330be841bf02d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page