Package: wotapi
World of Tanks - API (PC)1. DescriptionThis package will extract data from the Wargaming World of Tanks API.Currently, this works only for the PC version with the rest of the platforms to be implemented in future iterations.The package will require the following from the officialWorld of Tanks Developer APIpage.application idaccount idaccess tokenAll data extracted will be written to a local sqlite database ready to be accessed. The database is automatically created
at the location where the script is executed.The name of the database isworld_of_tanks.dbof type sqlite.2. Installpip install WotAPI3. UsagefromwotapiimportWotAPI,REALM# Obtain the account id# Since this is a constant it can be executed only once to get the account_idwot=WotAPI(application_id='############',realm=REALM.eu)account_id=wot.get_account_id(nickname='username')wot=WotAPI(application_id='############',account_id=account_id,token='#########',realm='eu')# Extract Account Datawot.player_personal()wot.player_vehicles()wot.player_achievements()# Extract Tankopedia Datawot.tankopedia_vehicles(load_once=True)wot.tankopedia_achievements(load_once=True)wot.tankopedia_information(load_once=True)wot.tankopedia_maps(load_once=True)wot.tankopedia_badges(load_once=True)# Extract Player Vehicles Datawot.vehicle_achievements()wot.vehicle_statistics()# Renew access tokennew_token_data=wot.renew_token()print(new_token_data)All data from the Tankopedia part of the API needs to be loaded only once in the database, otherwise this will be duplicated.
For ease, the argumentload_onceis by default set to True.The data can be accessed from thewotobjects for further development. The response is a list of dictionaries.achievements = wot.player_achivements(load_once=True)
print(achievements)

[{
'name': 'medalBobAmway921', 
'outdated': True, 
'section': 'action', 
'section_order': 6, 
'image_big': 'http://api.worldoftanks.eu/static/2.66.0/wot/encyclopedia/achievement/big/medalBobAmway921.png', 
'hero_info': None, 
'name_i18n': None, 
'order': 1443, 
'type': 'single', 
'image': 'http://api.worldoftanks.eu/static/2.66.0/wot/encyclopedia/achievement/medalBobAmway921.png', 
'condition': 'None', 
'description': None
} ... 
]To not load data in the database add theload_to_db=Falseargument to the WotAPI class parameters.
To give a specific location for the database to be created and populated set up the following arguments in the main class.from worldoftanks import WotAPI

wot = WotAPI(application_id='####',
             account_id='##########',
             token='#########',
             realm='eu',
             load_to_db=True,
             db_path=<path_where_the_database_will_be_saved>,
             logging_enabled=True/False,
             log_level="WARNING"                     
    )4. Left To DoAPI PartNameDate CompletedVersionAccountsPlayer Personal Data2020-04-240.0.1AccountsPlayer Vehicles2020-04-240.0.1AccountsPlayer Achievements2020-04-240.0.1TankopediaVehicles2020-04-250.0.2TankopediaAchievements2020-04-250.0.2TankopediaTankopedia Information2020-04-250.0.2TankopediaMaps2020-04-250.0.2TankopediaBadges2020-04-280.4.22TankopediaVehicle characteristicsTankopediaEnginesDeprecatedTankopediaTurretsDeprecatedTankopediaRadiosDeprecatedTankopediaSuspensionsDeprecatedTankopediaGunsDeprecatedTankopediaEquipment and ConsumablesTankopediaPersonal MissionsTankopediaPersonal ReservesTankopediaVehicle ConfigurationsTankopediaModulesTankopediaCrew QualificationsTankopediaCrew SkillsVehiclesVehicle statistics2020-04-270.3.2VehiclesVehicle achievements2020-04-270.3.2ClansClansClansClan DetailsClansClan Member DetailsClansClan GlossaryClansMessage BoardClansPlayer Clan HistoryClan ratingsTypes of RatingsClan ratingsDates with available r.Clan ratingsClan RatingsClan ratingsAdj Positions In Clan R.Clan ratingsTop ClansStrongholdsGlobal Map5. DevelopmentTo further develop this package please follow the instructions below# Install the virtual environments and packagespython3-mvirtualenv.venvsource.venv/bin/activate
pip3install-rrequirements.txt# Run test suite# Tests contain unittests, coverage and lintingtox