import papi api papi Session papi Server RU demo player_info papi Acco

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
>>> import papi
>>> api = papi.Session(papi.Server.RU, 'demo')
>>> player_info = papi.Accounts(api)
>>> dir(player_info)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'api', 'getAccountAchievements', 'getAccountID', 'getAccountInfo', 'getAccountList', 'getAccountTanks']
>>> print player_info.getAccountTanks.__doc__
getAccountTanks(params)
Method returns details on player's vehicles.
>>> print player_info.getAccountID.__doc__
getAccountID(name)
Method returns account ID by name.
>>> player_info.getAccountID('serb')
'461'
>>> for t in player_info.getAccountTanks({'account_id': '461'})['461'][:5]:
print t
{u'statistics': {u'wins': 462, u'battles': 864}, u'mark_of_mastery': 3, u'tank_id': 53249}
{u'statistics': {u'wins': 464, u'battles': 763}, u'mark_of_mastery': 4, u'tank_id': 7937}
{u'statistics': {u'wins': 411, u'battles': 700}, u'mark_of_mastery': 3, u'tank_id': 4353}
{u'statistics': {u'wins': 321, u'battles': 660}, u'mark_of_mastery': 4, u'tank_id': 54289}
{u'statistics': {u'wins': 350, u'battles': 639}, u'mark_of_mastery': 4, u'tank_id': 49}
>>> for t in player_info.getAccountTanks({'account_id': '461', 'fields': 'tank_id,mark_of_mastery'})['461'][:5]:
print t
{u'mark_of_mastery': 3, u'tank_id': 53249}
{u'mark_of_mastery': 4, u'tank_id': 7937}
{u'mark_of_mastery': 3, u'tank_id': 4353}
{u'mark_of_mastery': 4, u'tank_id': 54289}
{u'mark_of_mastery': 4, u'tank_id': 49}