Package: wt-profile-tool
WT Profile ToolDescriptionThis package contains set of tools used to to fetch War Thunder profiles, including:Get user profile by IDGet user ID by nicketc...All data comes from public API.IMPORTANT: This project isNOTaffiliated with Gaijin Entertainment in any way, but is built by developers in the War Thunder community who love War Thunder.If it infringes upon your rights, please contact author.Many thanks to@RaidFourmsfor his immense help which inspired this project.Not a python developer?You can use API server directly byRaidFourms's wtpt-apiproject.Don't know how to use API server?Well, this is a tool project and not intended for non-developers 😵😵😵UsageInstallYou can easily install it with pip:pipinstallwt-profile-toolOr you can install it withPoetry:poetryaddwt-profile-toolInitialize the toolyou can simply import the class and use it like the followingfromwt_profile_toolimportWTPTClientclient=WTPTClient()Or you can customize the client, for example, you want to set all request timeout to 30 secondsclient=WTPTClient(http_client=httpx.Client(timeout=httpx.Timeout(30.0)),)You can customize the http_client to enable proxy, headers, etc.Random user agent when sending request?client=WTPTClient(random_ua=True)For more information about the parameters, please refer to the client description.For old versionWTProfileToolis still available, but it is not recommended to use it. it has been makred deprecated and will be removed in the future. You can simply import the class and use it like the followingfromwt_profile_toolimportWTProfileToolwtpt=WTProfileTool()...Get player's userid by nickname prefixAfter you initialize the tool, you can use client's method to get player's userid by nickname prefix.# This guy is real existdata=client.get_player_userid_by_prefix_nick("OnTheRocks")Note: Every time you call a method needs to send http request, it will send a request to a War Thunder server. Make sure your network can access the server andDO NOT ABUSE IT.Get player's profile by useridAfter you have the userid, you can use another method to get player's profile.# This guy is OnTheRocksprofile=client.get_player_profile_by_userid("5363987")Then, you can do something with theprofile.base_info = profile.base_info

nick = base_info.nickprofileis aPydantic V2 BaseModel, you can useprofile.model_dump_json()to get the json string if you like.profile_json=profile.model_dump_json()A JSON string should look like the following:{"base_info":{"user_id":"","nick":"OnTheRocks","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":[]}NOTE:Data seems broken or missmatch? Please open an issue and provide a right example.Maybe you want to know why I use playerOnTheRocksas an example. Because he was a cheater. I reported him and he was banned. This is the price you pay for using cheats to kill me 5 times in one battle. 😡😡😡More features?You can refer to theWTPTClient's descritpion to find more available methods.ContributingIf you have any issues or suggestions feel free to open one.Pull requests are welcome.For major changes, please open an issue first to discuss what you would like to change.LicenseMIT License