Skip to main content

wt-profile-tool contains set of tools used to fetch user profile from the WarThunder server

Project description

WT Profile Tool

Lint Test Publish to PyPI and TestPyPI codecov

Description

This package contains set of tools used to fetch user profile from the WarThunder server, include serval operation like:

  • get userid by nick
  • get user profile by userid

Usage

First, you need to install the package. For example use pip directly:

pip install wt-profile-tool

also you can install it by Poetry:

poetry add wt-profile-tool

Then, You can simply import the class and use it like this:

from wt_profile_tool import WTProfileTool

tool = WTProfileTool()
profile = tool.get_profile_by_userid("5363987")
print(profile)

Note: Every time you call get_profile_by_userid will send a request to WarThunder server. Make sure your network can access the server and DO NOT ABUSE IT.

Finally, you can do something with the data. Data class is a Pydantic BaseModel, you can use profile.dump_model_as_json() to get the json string if you like.

a json string should be like:

{
  "base_info": {
    "user_id": "",
    "nick": "OnTheRocks", # he was banned (i reported him), so his account is suiteable for example.
    "icon_id": null,
    "title": "Tank Destroyer",
    "clan_id": null,
    "clan_tag": null,
    "clan_type": null,
    "clan_name": null,
    "clan_member_role": null
  },
  "level_info": {
    "level": 100,
    "exp_has": 27169491,
    "exp_left": 27169491,
    "completeness": 4.6071824188000174e18
  },
  "lang": "en",
  "battle_list": [...],
  ...
}

Contributing

Pull requests are welcome.

License

MIT License

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

wt_profile_tool-0.2.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

wt_profile_tool-0.2.0-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

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