Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit c87b0fe

Browse files
TodoLodoEngineer152
andcommitted
Update, date - Fri 10/28/2022, time - 1:18:24.09
Co-authored-by: Engineer15 <engineergamer15@gmail.com>
1 parent 3697487 commit c87b0fe

File tree

1 file changed

+177
-4
lines changed

1 file changed

+177
-4
lines changed

README.rst

Lines changed: 177 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,32 @@ Here's an example for retrieving **Warzone** full profile history of a player wh
246246
.. code-block:: python
247247
248248
from cod_api import API, platforms
249+
import asyncio
249250
250251
# initiating the API class
251252
api = API()
252253
253254
# loggin in with sso token
254255
api.login('your_sso_token')
255256
257+
## sync
256258
# retrieving combat history
257259
profile = api.Warzone.fullData(platforms.Battlenet, "Username#1234") # returns data of type dict
258260
259261
# printing results to console
260262
print(profile)
261263
264+
## async
265+
# in an async function
266+
async def example():
267+
# retrieving combat history
268+
profile = await api.Warzone.fullDataAsync(platforms.Battlenet, "Username#1234") # returns data of type dict
269+
270+
# printing results to console
271+
print(profile)
272+
273+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
274+
262275
263276
Combat History
264277
--------------
@@ -282,12 +295,24 @@ Here's an example for retrieving **Warzone** combat history of a player whose ga
282295
# loggin in with sso token
283296
api.login('your_sso_token')
284297
298+
## sync
285299
# retrieving combat history
286300
hist = api.Warzone.combatHistory(platforms.Battlenet, "Username#1234") # returns data of type dict
287301
288302
# printing results to console
289303
print(hist)
290304
305+
## async
306+
# in an async function
307+
async def example():
308+
# retrieving combat history
309+
hist = await api.Warzone.combatHistoryAsync(platforms.Battlenet, "Username#1234") # returns data of type dict
310+
311+
# printing results to console
312+
print(hist)
313+
314+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
315+
291316
The ``combatHistoryWithDate()`` takes 4 input parameteres which are ``platform``, ``gamertag``, ``start`` and ``end`` of
292317
type `cod_api.platforms`_, string, int and int respectively.
293318

@@ -307,11 +332,23 @@ platform **Activision** with in the timestamps **1657919309** (Friday, 15 July 2
307332
# loggin in with sso token
308333
api.login('your_sso_token')
309334
335+
## sync
310336
# retrieving combat history
311337
hist = api.Warzone.combatHistoryWithDate(platforms.Activision, "Username#1234567", 1657919309, 1657949309) # returns data of type dict
312338
313339
# printing results to console
314340
print(hist)
341+
342+
## async
343+
# in an async function
344+
async def example():
345+
# retrieving combat history
346+
hist = await api.Warzone.combatHistoryWithDateAsync(platforms.Battlenet, "Username#1234", 1657919309, 1657949309) # returns data of type dict
347+
348+
# printing results to console
349+
print(hist)
350+
351+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
315352
316353
Additionally the methods ``breakdown()`` and ``breakdownWithDate()`` can be used to retrieve combat history without
317354
details, where only the platform played on, game title, UTC timestamp, type ID, match ID and map ID is returned for
@@ -334,12 +371,24 @@ on platform **Battlenet**:
334371
# loggin in with sso token
335372
api.login('your_sso_token')
336373
374+
## sync
337375
# retrieving combat history breakdown
338376
hist_b = api.Warzone.breakdown(platforms.Battlenet, "Username#1234") # returns data of type dict
339377
340378
# printing results to console
341379
print(hist_b)
342380
381+
## async
382+
# in an async function
383+
async def example():
384+
# retrieving combat history breakdown
385+
hist_b = await api.Warzone.breakdownAsync(platforms.Battlenet, "Username#1234") # returns data of type dict
386+
387+
# printing results to console
388+
print(hist_b)
389+
390+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
391+
343392
The ``breakdownWithDate()`` takes 4 input parameteres which are ``platform``, ``gamertag``, ``start`` and ``end`` of
344393
type `cod_api.platforms`_, string, int and int respectively.
345394

@@ -359,12 +408,24 @@ and **1657949309** (Saturday, 16 July 2022 05:28:29):
359408
# loggin in with sso token
360409
api.login('your_sso_token')
361410
411+
## sync
362412
# retrieving combat history breakdown
363413
hist_b = api.Warzone.breakdownWithDate(platforms.Activision, "Username#1234567", 1657919309, 1657949309) # returns data of type dict
364414
365415
# printing results to console
366416
print(hist_b)
367417
418+
## async
419+
# in an async function
420+
async def example():
421+
# retrieving combat history breakdown
422+
hist_b = await api.Warzone.breakdownWithDateAsync(platforms.Battlenet, "Username#1234", 1657919309, 1657949309) # returns data of type dict
423+
424+
# printing results to console
425+
print(hist_b)
426+
427+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
428+
368429
Match Details
369430
-------------
370431

@@ -391,12 +452,24 @@ on platform **Battlenet**:
391452
# loggin in with sso token
392453
api.login('your_sso_token')
393454
455+
## sync
394456
# retrieving match details
395457
details = api.Warzone.matchInfo(platforms.Battlenet, 9484583876389482453) # returns data of type dict
396458
397459
# printing results to console
398460
print(details)
399461
462+
## async
463+
# in an async function
464+
async def example():
465+
# retrieving match details
466+
details = await api.Warzone.matchInfoAsync(platforms.Battlenet, 9484583876389482453) # returns data of type dict
467+
468+
# printing results to console
469+
print(details)
470+
471+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
472+
400473
Season Loot
401474
-----------
402475

@@ -419,12 +492,24 @@ platform **Battlenet**:
419492
# loggin in with sso token
420493
api.login('your_sso_token')
421494
495+
## sync
422496
# retrieving season loot
423497
loot = api.ColdWar.seasonLoot(platforms.Battlenet, "Username#1234") # returns data of type dict)
424498
425499
# printing results to console
426500
print(loot)
427501
502+
## async
503+
# in an async function
504+
async def example():
505+
# retrieving season loot
506+
loot = await api.ColdWar.seasonLootAsync(platforms.Battlenet, 9484583876389482453) # returns data of type dict
507+
508+
# printing results to console
509+
print(loot)
510+
511+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
512+
428513
Map List
429514
--------
430515

@@ -446,12 +531,25 @@ Here's an example for retrieving **Vanguard** map list and available modes respe
446531
# loggin in with sso token
447532
api.login('your_sso_token')
448533
534+
## sync
449535
# retrieving maps and respective modes available
450-
maps = api.Vanguard.mapList(platforms.PSN) # returns data of type dict)
536+
maps = api.Vanguard.mapList(platforms.PSN) # returns data of type dict
451537
452538
# printing results to console
453539
print(maps)
454540
541+
## async
542+
# in an async function
543+
async def example():
544+
# retrieving season loot
545+
maps = await api.Vanguard.mapListAsync(platforms.PSN) # returns data of type dict
546+
547+
# printing results to console
548+
print(maps)
549+
550+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
551+
552+
455553
.. _cod_api.platforms:
456554

457555
platforms
@@ -537,11 +635,23 @@ logged in with
537635
# loggin in with sso token
538636
api.login('your_sso_token')
539637
638+
## sync
540639
# retrieving user friend feed
541640
friendFeed = api.Me.friendFeed() # returns data of type dict
542641
543642
# printing results to console
544643
print(friendFeed)
644+
645+
## async
646+
# in an async function
647+
async def example():
648+
# retrieving user friend feed
649+
friendFeed = await api.Me.friendFeedAsync() # returns data of type dict
650+
651+
# printing results to console
652+
print(friendFeed)
653+
654+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
545655
546656
User Event Feed
547657
----------------
@@ -559,12 +669,24 @@ logged in with
559669
# loggin in with sso token
560670
api.login('your_sso_token')
561671
672+
## sync
562673
# retrieving user event feed
563674
eventFeed = api.Me.eventFeed() # returns data of type dict
564675
565676
# printing results to console
566677
print(eventFeed)
567678
679+
## async
680+
# in an async function
681+
async def example():
682+
# retrieving user event feed
683+
eventFeed = await api.Me.eventFeedAsync() # returns data of type dict
684+
685+
# printing results to console
686+
print(eventFeed)
687+
688+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
689+
568690
User Identities
569691
----------------
570692

@@ -581,12 +703,24 @@ sso-token logged in with
581703
# loggin in with sso token
582704
api.login('your_sso_token')
583705
706+
## sync
584707
# retrieving user identities
585708
identities = api.Me.loggedInIdentities() # returns data of type dict
586709
587710
# printing results to console
588711
print(identities)
589712
713+
## async
714+
# in an async function
715+
async def example():
716+
# retrieving user identities
717+
identities = await api.Me.loggedInIdentitiesAsync() # returns data of type dict
718+
719+
# printing results to console
720+
print(identities)
721+
722+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
723+
590724
User COD Points
591725
----------------
592726

@@ -603,12 +737,24 @@ logged in with
603737
# loggin in with sso token
604738
api.login('your_sso_token')
605739
740+
## sync
606741
# retrieving user cod points
607742
cp = api.Me.codPoints() # returns data of type dict
608743
609744
# printing results to console
610745
print(cp)
611746
747+
## async
748+
# in an async function
749+
async def example():
750+
# retrieving user cod points
751+
cp = await api.Me.codPointsAsync() # returns data of type dict
752+
753+
# printing results to console
754+
print(cp)
755+
756+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
757+
612758
User Accounts
613759
----------------
614760

@@ -625,12 +771,24 @@ the sso-token logged in with
625771
# loggin in with sso token
626772
api.login('your_sso_token')
627773
774+
## sync
628775
# retrieving user connected accounts
629-
accounts = api.Me.codPoints() # returns data of type dict
776+
accounts = api.Me.connectedAccounts() # returns data of type dict
630777
631778
# printing results to console
632779
print(accounts)
633780
781+
## async
782+
# in an async function
783+
async def example():
784+
# retrieving user connected accounts
785+
accounts = await api.Me.connectedAccountsAsync() # returns data of type dict
786+
787+
# printing results to console
788+
print(accounts)
789+
790+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
791+
634792
User settings
635793
----------------
636794

@@ -647,18 +805,33 @@ in with
647805
# loggin in with sso token
648806
api.login('your_sso_token')
649807
808+
## sync
650809
# retrieving user settings
651810
settings = api.Me.settings() # returns data of type dict
652811
653812
# printing results to console
654813
print(settings)
655814
815+
## async
816+
# in an async function
817+
async def example():
818+
# retrieving user settings
819+
settings = await api.Me.settingsAsync() # returns data of type dict
820+
821+
# printing results to console
822+
print(settings)
823+
824+
# CALL THE example FUNCTION IN AN ASYNC ENVIRONMENT
825+
656826
-------------------------------------------------------------------------------------------------------------------------------
657827

658828
Donate
659829
======
660830

661-
`Donate Todo Lodo`_ and `Donate Engineer152`_
831+
* `Donate Todo Lodo`_
832+
* `Donate Engineer152`_
833+
* `Donate Werseter`_
662834

663-
.. _Donate Engineer152: https://www.paypal.com/paypalme/engineer15
664835
.. _Donate Todo Lodo: https://www.buymeacoffee.com/todolodo2089
836+
.. _Donate Engineer152: https://www.paypal.com/paypalme/engineer15
837+
.. _Donate Werseter: https://paypal.me/werseter

0 commit comments

Comments
 (0)