Skip to main content

API wrapper for Tanki Online's ratings API

Project description

Tanki

Tanki is an API wrapper for Tanki Online's rating API. Allows you to easily search for users and get information about them. To get started, create a new Profile object using tanki.Profile('username')

Notes

  • raw_time_played returns time in milliseconds
  • If you don't own the grade of a hull, module, or turret, it'll return None for all attributes

Quick Start

import tanki

# initialize a object
profile = tanki.Profile('walker38552')

# get kills and deaths
print(f'Kills: {profile.kills}, Deaths: {profile.deaths}')

# get k/d ratio
print(f'K/D: {profile.kd}')

# get rank
print(profile.get_rank())
print(profile.get_rank().rank_name)

# get drone data
for drone in profile.get_drones_played():
    print(drone.name, drone.score_earned, drone.time_played_hours)

# get hull data
for hull in profile.get_hulls_played():
    print(hull.name, hull.time_played_hours)
    # show statistics for each grade of the hull
    print(hull.grades.mk1.score_earned)
    print(hull.grades.mk2.score_earned)
    print(hull.grades.mk3.score_earned)
    print(hull.grades.mk4.score_earned)
    print(hull.grades.mk5.score_earned)
    print(hull.grades.mk6.score_earned)
    print(hull.grades.mk7.score_earned)

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

Tanki-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file Tanki-1.0.0.tar.gz.

File metadata

  • Download URL: Tanki-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for Tanki-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8b56c9729e294e3ba5bd977b81949c1075c42ff32733e3cd004a5b6011d7a43e
MD5 f0d771e4cddd079b41089759cb77fa42
BLAKE2b-256 73da338f071b5d1334524fa3073b9314fd8ef4b4680f4eedb22df40e494d721f

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