wt-profile-tool contains set of tools used to fetch user profile from the WarThunder server
Project description
WT Profile Tool
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
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
Built Distribution
Hashes for wt_profile_tool-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2102ea411fd9da611a0377f7490d1ea70c45996071edbdaf3130c312a9f05adb |
|
MD5 | c28cbabbed1993243b758461fe1aa91e |
|
BLAKE2b-256 | 6b7a52eb98e65011453aaf6539ed3e5844b2b5a3329c9f22d1735d9096c66baf |