cocapi 2.2.3__tar.gz → 2.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cocapi-2.2.4/PKG-INFO ADDED
@@ -0,0 +1,1192 @@
1
+ Metadata-Version: 2.4
2
+ Name: cocapi
3
+ Version: 2.2.4
4
+ Summary: A python wrapper around clash of clans api
5
+ Project-URL: Homepage, https://github.com/tonybenoy/cocapi
6
+ Project-URL: Repository, https://github.com/tonybenoy/cocapi
7
+ Project-URL: Issues, https://github.com/tonybenoy/cocapi/issues
8
+ Author-email: Tony Benoy <me@tonybenoy.com>
9
+ License: GPL-3.0
10
+ License-File: LICENSE
11
+ Keywords: api,clans,clash,supercell,wrapper
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Requires-Python: >=3.7.2
23
+ Requires-Dist: httpx<1.0.0,>=0.23.0
24
+ Provides-Extra: pydantic
25
+ Requires-Dist: pydantic>=2.0.0; extra == 'pydantic'
26
+ Description-Content-Type: text/markdown
27
+
28
+ <p>
29
+ <a href="https://github.com/tonybenoy/cocapi/actions">
30
+ <img src="https://github.com/tonybenoy/cocapi/workflows/CI/badge.svg" alt="CI Status" height="20">
31
+ </a>
32
+ <a href="https://pypi.org/project/cocapi/"><img src="https://img.shields.io/pypi/v/cocapi" alt="Pypi version" height="21"></a>
33
+ </p>
34
+ <p>
35
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.7+-blue.svg" alt="Python version" height="17"></a>
36
+ <a href="https://github.com/tonybenoy/cocapi/blob/master/LICENSE"><img src="https://img.shields.io/github/license/tonybenoy/cocapi" alt="License" height="17"></a>
37
+ <a href="https://github.com/astral-sh/ruff">
38
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" height="17">
39
+ </a>
40
+ </p>
41
+
42
+ # ClashOfClansAPI
43
+
44
+ A high-performance Python wrapper for SuperCell's Clash of Clans API with enterprise-grade features including async support, response caching, retry logic, and configurable settings.
45
+
46
+ **🎯 Complete API Coverage**: All 22 official endpoints implemented
47
+ **⚡ High Performance**: Async support with intelligent caching
48
+ **🔄 100% Backward Compatible**: Drop-in replacement for existing code
49
+ **🛡️ Production Ready**: Retry logic, rate limiting, and comprehensive error handling
50
+
51
+ Get Token from [https://developer.clashofclans.com/](https://developer.clashofclans.com/)
52
+
53
+ ## Features
54
+
55
+ - **Synchronous and Asynchronous API support**
56
+ - **Intelligent response caching with TTL**
57
+ - **Automatic retry logic with exponential backoff**
58
+ - **Rate limiting protection**
59
+ - **Comprehensive error handling**
60
+ - **Type hints for better development experience**
61
+ - **Optional Pydantic models for structured data validation**
62
+ - **100% backward compatible**
63
+ - **Configurable settings**
64
+
65
+ # Install
66
+
67
+ ```bash
68
+ # Standard installation (dict responses)
69
+ pip install cocapi
70
+
71
+ # With optional Pydantic models support
72
+ pip install 'cocapi[pydantic]'
73
+ ```
74
+
75
+
76
+ # Usage Examples
77
+
78
+ ## Basic Synchronous Usage (Backward Compatible)
79
+
80
+ ```python
81
+ from cocapi import CocApi
82
+
83
+ token = 'YOUR_API_TOKEN'
84
+ timeout = 60 # requests timeout
85
+
86
+ # Basic initialization (same as before)
87
+ api = CocApi(token, timeout)
88
+
89
+ # With status codes (same as before)
90
+ api = CocApi(token, timeout, status_code=True)
91
+ ```
92
+
93
+ ## Advanced Configuration
94
+
95
+ ```python
96
+ from cocapi import CocApi, ApiConfig
97
+
98
+ # Custom configuration
99
+ config = ApiConfig(
100
+ timeout=30,
101
+ max_retries=5,
102
+ cache_ttl=600, # Cache for 10 minutes
103
+ enable_caching=True,
104
+ retry_delay=2 # Initial retry delay in seconds
105
+ )
106
+
107
+ api = CocApi('YOUR_API_TOKEN', config=config)
108
+
109
+ # Cache management
110
+ stats = api.get_cache_stats()
111
+ api.clear_cache() # Clear all cached responses
112
+ ```
113
+
114
+ ## Asynchronous Usage
115
+
116
+ ```python
117
+ import asyncio
118
+ from cocapi import CocApi, ApiConfig
119
+
120
+ async def main():
121
+ # Method 1: Automatic async mode with context manager (recommended)
122
+ async with CocApi('YOUR_API_TOKEN') as api:
123
+ clan = await api.clan_tag('#CLAN_TAG')
124
+ player = await api.players('#PLAYER_TAG')
125
+
126
+ # Method 2: Explicit async mode
127
+ api = CocApi('YOUR_API_TOKEN', async_mode=True)
128
+ async with api:
129
+ clan = await api.clan_tag('#CLAN_TAG')
130
+
131
+ # Method 3: With custom configuration
132
+ config = ApiConfig(timeout=30, enable_caching=True)
133
+ async with CocApi('YOUR_API_TOKEN', config=config) as api:
134
+ clan = await api.clan_tag('#CLAN_TAG')
135
+
136
+ # Run async code
137
+ asyncio.run(main())
138
+ ```
139
+
140
+ ## Pydantic Models (Optional)
141
+
142
+ For enhanced type safety and structured data validation, cocapi supports optional Pydantic models:
143
+
144
+ ```python
145
+ from cocapi import CocApi, ApiConfig, Clan, Player
146
+
147
+ # Enable Pydantic models
148
+ config = ApiConfig(use_pydantic_models=True)
149
+ api = CocApi('YOUR_API_TOKEN', config=config)
150
+
151
+ # Get structured clan data
152
+ clan = api.clan_tag('#2PP') # Returns Clan model instead of dict
153
+ print(clan.name) # Type-safe attribute access
154
+ print(clan.clan_level) # IDE autocompletion support
155
+ print(clan.members) # Validated data structure
156
+
157
+ # Get structured player data
158
+ player = api.players('#PLAYER_TAG') # Returns Player model
159
+ print(player.town_hall_level) # Type-safe attributes
160
+ print(player.trophies)
161
+ print(player.clan.name if player.clan else "No clan")
162
+
163
+ # Works with async too
164
+ async def get_data():
165
+ config = ApiConfig(use_pydantic_models=True)
166
+ async with CocApi('YOUR_TOKEN', config=config) as api:
167
+ clan = await api.clan_tag('#TAG') # Returns Clan model
168
+ return clan.name
169
+
170
+ # Available models: Clan, Player, ClanMember, League, Achievement, etc.
171
+ # Import them: from cocapi import Clan, Player, ClanMember
172
+ ```
173
+
174
+ ### Benefits of Pydantic Models
175
+
176
+ - **Type Safety**: Catch errors at development time
177
+ - **IDE Support**: Full autocompletion and type hints
178
+ - **Data Validation**: Automatic validation of API responses
179
+ - **Clean Interface**: Object-oriented access to data
180
+ - **Documentation**: Self-documenting code with model schemas
181
+ - **Optional**: Zero impact if not used (lazy imports)
182
+
183
+ ## Performance Comparison
184
+
185
+ The new features provide significant performance improvements:
186
+
187
+ - **Caching**: Up to 100% faster for repeated requests
188
+ - **Async**: Handle multiple requests concurrently
189
+ - **Retry Logic**: Automatic handling of temporary failures
190
+ - **Rate Limiting**: Built-in protection against API limits
191
+
192
+ ## Migration Guide
193
+
194
+ ### For Existing Users
195
+
196
+ **No breaking changes!** Your existing code will continue to work exactly as before:
197
+
198
+ ```python
199
+ # This still works exactly the same
200
+ from cocapi import CocApi
201
+ api = CocApi('YOUR_TOKEN', 60, status_code=True)
202
+ clan = api.clan_tag('#CLAN_TAG')
203
+ ```
204
+
205
+ ### Upgrading to New Features
206
+
207
+ To take advantage of new features:
208
+
209
+ ```python
210
+ from cocapi import CocApi, ApiConfig
211
+
212
+ # 1. Add caching to existing code (no changes needed!)
213
+ config = ApiConfig(enable_caching=True, cache_ttl=300)
214
+ api = CocApi('YOUR_TOKEN', config=config)
215
+
216
+ # 2. Use async for better performance (same class!)
217
+ async with CocApi('YOUR_TOKEN') as api:
218
+ clan = await api.clan_tag('#CLAN_TAG')
219
+
220
+ # 3. Enhanced error handling is automatic
221
+ result = api.clan_tag('#INVALID_TAG')
222
+ if result.get('result') == 'error':
223
+ print(f"Error: {result.get('message')}")
224
+ ```
225
+
226
+ ---
227
+
228
+ ## What's New in v2.2.0+
229
+
230
+ 🆕 **Latest in v2.2.0:**
231
+ - **Optional Pydantic Models**: Type-safe, validated data structures with IDE support
232
+ - **Enhanced Type Safety**: Full Pydantic model support for `Clan`, `Player`, and all API responses
233
+ - **Flexible Configuration**: Enable/disable Pydantic models via `ApiConfig.use_pydantic_models`
234
+ - **Lazy Loading**: Zero impact when not using models (automatic imports)
235
+ - **Async + Pydantic**: Full async support with Pydantic model validation
236
+ - **Comprehensive Models**: 15+ Pydantic models covering all API response types
237
+
238
+ ## What's New in v2.1.0+
239
+
240
+ ✨ **Major New Features:**
241
+ - **Unified Async Support**: Same `CocApi` class works for both sync and async!
242
+ - **Intelligent Caching**: Automatic response caching with configurable TTL
243
+ - **Retry Logic**: Exponential backoff for handling temporary API failures
244
+ - **Enhanced Configuration**: Flexible settings via ApiConfig class
245
+ - **Better Error Handling**: Comprehensive error messages and types
246
+ - **Type Hints**: Complete type annotations for better IDE support
247
+ - **Rate Limiting Protection**: Built-in handling of API rate limits
248
+ - **🆕 Optional Pydantic Models**: Type-safe, validated data structures with IDE support
249
+
250
+ 🔧 **Code Quality Improvements:**
251
+ - Fixed all mutable default arguments
252
+ - Added comprehensive logging
253
+ - Improved test coverage
254
+ - Enhanced documentation
255
+
256
+ 📚 **Full API Reference**
257
+
258
+ The following sections document all available API methods. All methods work identically in both sync and async modes - just use `await` when in async context!
259
+
260
+ ---
261
+
262
+ ## Clans
263
+
264
+ ### Information about a Clan
265
+ ```python
266
+ api.clan_tag(tag) #example tag "#9UOVJJ9J"
267
+ ```
268
+ <details>
269
+ <summary>Click to view output</summary>
270
+
271
+ ```text
272
+ {
273
+ "warLeague": {
274
+ "name": {},
275
+ "id": 0
276
+ },
277
+ "memberList": [
278
+ {
279
+ "league": {
280
+ "name": {},
281
+ "id": 0,
282
+ "iconUrls": {}
283
+ },
284
+ "tag": "string",
285
+ "name": "string",
286
+ "role": "string",
287
+ "expLevel": 0,
288
+ "clanRank": 0,
289
+ "previousClanRank": 0,
290
+ "donations": 0,
291
+ "donationsReceived": 0,
292
+ "trophies": 0,
293
+ "versusTrophies": 0
294
+ }
295
+ ],
296
+ "isWarLogPublic": true,
297
+ "tag": "string",
298
+ "warFrequency": "string",
299
+ "clanLevel": 0,
300
+ "warWinStreak": 0,
301
+ "warWins": 0,
302
+ "warTies": 0,
303
+ "warLosses": 0,
304
+ "clanPoints": 0,
305
+ "clanVersusPoints": 0,
306
+ "requiredTrophies": 0,
307
+ "name": "string",
308
+ "location": {
309
+ "localizedName": "string",
310
+ "id": 0,
311
+ "name": "string",
312
+ "isCountry": true,
313
+ "countryCode": "string"
314
+ },
315
+ "type": "string",
316
+ "members": 0,
317
+ "labels": [
318
+ {
319
+ "name": {},
320
+ "id": 0,
321
+ "iconUrls": {}
322
+ }
323
+ ],
324
+ "description": "string",
325
+ "badgeUrls": {}
326
+ }
327
+ ```
328
+ </details>
329
+
330
+ #### Members Only
331
+ ```python
332
+ api.clan_members(tag)
333
+ ```
334
+ returns membersList information from api.clan_tag(tag) under "items" in dict
335
+
336
+ ### War Log Information
337
+ ```python
338
+ api.clan_war_log(tag)
339
+ ```
340
+ <details>
341
+ <summary>Click to view output</summary>
342
+
343
+ ```text
344
+ {items:
345
+ [
346
+ {
347
+ "clan": {
348
+ "destructionPercentage": {},
349
+ "tag": "string",
350
+ "name": "string",
351
+ "badgeUrls": {},
352
+ "clanLevel": 0,
353
+ "attacks": 0,
354
+ "stars": 0,
355
+ "expEarned": 0,
356
+ "members": [
357
+ {
358
+ "tag": "string",
359
+ "name": "string",
360
+ "mapPosition": 0,
361
+ "townhallLevel": 0,
362
+ "opponentAttacks": 0,
363
+ "bestOpponentAttack": {
364
+ "order": 0,
365
+ "attackerTag": "string",
366
+ "defenderTag": "string",
367
+ "stars": 0,
368
+ "destructionPercentage": 0
369
+ },
370
+ "attacks": [
371
+ {
372
+ "order": 0,
373
+ "attackerTag": "string",
374
+ "defenderTag": "string",
375
+ "stars": 0,
376
+ "destructionPercentage": 0
377
+ }
378
+ ]
379
+ }
380
+ ]
381
+ },
382
+ "teamSize": 0,
383
+ "opponent": {
384
+ "destructionPercentage": {},
385
+ "tag": "string",
386
+ "name": "string",
387
+ "badgeUrls": {},
388
+ "clanLevel": 0,
389
+ "attacks": 0,
390
+ "stars": 0,
391
+ "expEarned": 0,
392
+ "members": [
393
+ {
394
+ "tag": "string",
395
+ "name": "string",
396
+ "mapPosition": 0,
397
+ "townhallLevel": 0,
398
+ "opponentAttacks": 0,
399
+ "bestOpponentAttack": {
400
+ "order": 0,
401
+ "attackerTag": "string",
402
+ "defenderTag": "string",
403
+ "stars": 0,
404
+ "destructionPercentage": 0
405
+ },
406
+ "attacks": [
407
+ {
408
+ "order": 0,
409
+ "attackerTag": "string",
410
+ "defenderTag": "string",
411
+ "stars": 0,
412
+ "destructionPercentage": 0
413
+ }
414
+ ]
415
+ }
416
+ ]
417
+ },
418
+ "endTime": "string",
419
+ "result": "string"
420
+ }
421
+ ],
422
+ "paging": {'cursors': {}}
423
+ }
424
+ ```
425
+ </details>
426
+
427
+ ### Current War Information
428
+ ```python
429
+ api.clan_current_war(tag)
430
+ ```
431
+ <details>
432
+ <summary>Click to view output</summary>
433
+
434
+ ```text
435
+ {
436
+ "clan": {
437
+ "destructionPercentage": {},
438
+ "tag": "string",
439
+ "name": "string",
440
+ "badgeUrls": {},
441
+ "clanLevel": 0,
442
+ "attacks": 0,
443
+ "stars": 0,
444
+ "expEarned": 0,
445
+ "members": [
446
+ {
447
+ "tag": "string",
448
+ "name": "string",
449
+ "mapPosition": 0,
450
+ "townhallLevel": 0,
451
+ "opponentAttacks": 0,
452
+ "bestOpponentAttack": {
453
+ "order": 0,
454
+ "attackerTag": "string",
455
+ "defenderTag": "string",
456
+ "stars": 0,
457
+ "destructionPercentage": 0
458
+ },
459
+ "attacks": [
460
+ {
461
+ "order": 0,
462
+ "attackerTag": "string",
463
+ "defenderTag": "string",
464
+ "stars": 0,
465
+ "destructionPercentage": 0
466
+ }
467
+ ]
468
+ }
469
+ ]
470
+ },
471
+ "teamSize": 0,
472
+ "opponent": {
473
+ "destructionPercentage": {},
474
+ "tag": "string",
475
+ "name": "string",
476
+ "badgeUrls": {},
477
+ "clanLevel": 0,
478
+ "attacks": 0,
479
+ "stars": 0,
480
+ "expEarned": 0,
481
+ "members": [
482
+ {
483
+ "tag": "string",
484
+ "name": "string",
485
+ "mapPosition": 0,
486
+ "townhallLevel": 0,
487
+ "opponentAttacks": 0,
488
+ "bestOpponentAttack": {
489
+ "order": 0,
490
+ "attackerTag": "string",
491
+ "defenderTag": "string",
492
+ "stars": 0,
493
+ "destructionPercentage": 0
494
+ },
495
+ "attacks": [
496
+ {
497
+ "order": 0,
498
+ "attackerTag": "string",
499
+ "defenderTag": "string",
500
+ "stars": 0,
501
+ "destructionPercentage": 0
502
+ }
503
+ ]
504
+ }
505
+ ]
506
+ },
507
+ "startTime": "string",
508
+ "state": "string",
509
+ "endTime": "string",
510
+ "preparationStartTime": "string"
511
+ }
512
+ ```
513
+ </details>
514
+
515
+ ### Clan League Group Information
516
+ ```python
517
+ api.clan_leaguegroup(tag)
518
+ ```
519
+ <details>
520
+ <summary>Click to view output</summary>
521
+
522
+ ```text
523
+ {
524
+ "tag": "string",
525
+ "state": "string",
526
+ "season": "string",
527
+ "clans": [
528
+ {
529
+ "tag": "string",
530
+ "clanLevel": 0,
531
+ "name": "string",
532
+ "members": [
533
+ {
534
+ "tag": "string",
535
+ "townHallLevel": 0,
536
+ "name": "string"
537
+ }
538
+ ],
539
+ "badgeUrls": {}
540
+ }
541
+ ],
542
+ "rounds": [
543
+ {
544
+ "warTags": [
545
+ "string"
546
+ ]
547
+ }
548
+ ]
549
+ }
550
+ ```
551
+ </details>
552
+
553
+ ### Clan Capital Raid Seasons
554
+ ```python
555
+ api.clan_capitalraidseasons(tag)
556
+ ```
557
+ Retrieve clan's capital raid seasons information
558
+ <details>
559
+ <summary>Click to view output</summary>
560
+
561
+ ```text
562
+ {"items":
563
+ [
564
+ {
565
+ "state": "string",
566
+ "startTime": "string",
567
+ "endTime": "string",
568
+ "capitalTotalLoot": 0,
569
+ "raidsCompleted": 0,
570
+ "totalAttacks": 0,
571
+ "enemyDistrictsDestroyed": 0,
572
+ "offensiveReward": 0,
573
+ "defensiveReward": 0,
574
+ "members": [
575
+ {
576
+ "tag": "string",
577
+ "name": "string",
578
+ "attacks": 0,
579
+ "attackLimit": 0,
580
+ "bonusAttackLimit": 0,
581
+ "capitalResourcesLooted": 0
582
+ }
583
+ ]
584
+ }
585
+ ],
586
+ "paging": {'cursors': {}}
587
+ }
588
+ ```
589
+ </details>
590
+
591
+ ### Warleague Information
592
+ ```python
593
+ api.warleague(war_tag)
594
+ ```
595
+ <details>
596
+ <summary>Click to view output</summary>
597
+
598
+ ```text
599
+ {
600
+ "tag": "string",
601
+ "state": "string",
602
+ "season": "string",
603
+ "clans": [
604
+ {
605
+ "tag": "string",
606
+ "clanLevel": 0,
607
+ "name": "string",
608
+ "members": [
609
+ {
610
+ "tag": "string",
611
+ "townHallLevel": 0,
612
+ "name": "string"
613
+ }
614
+ ],
615
+ "badgeUrls": {}
616
+ }
617
+ ],
618
+ "rounds": [
619
+ {
620
+ "warTags": [
621
+ "string"
622
+ ]
623
+ }
624
+ ]
625
+ }
626
+ ```
627
+ </details>
628
+
629
+
630
+
631
+
632
+ ## Player
633
+
634
+ ### Player information
635
+ ```python
636
+ api.players(player_tag) #for example "#900PUCPV"
637
+ ```
638
+ <details>
639
+ <summary>Click to view output</summary>
640
+
641
+ ```text
642
+ {
643
+ "clan": {
644
+ "tag": "string",
645
+ "clanLevel": 0,
646
+ "name": "string",
647
+ "badgeUrls": {}
648
+ },
649
+ "league": {
650
+ "name": {},
651
+ "id": 0,
652
+ "iconUrls": {}
653
+ },
654
+ "townHallWeaponLevel": 0,
655
+ "versusBattleWins": 0,
656
+ "legendStatistics": {
657
+ "previousSeason": {
658
+ "trophies": 0,
659
+ "id": "string",
660
+ "rank": 0
661
+ },
662
+ "previousVersusSeason": {
663
+ "trophies": 0,
664
+ "id": "string",
665
+ "rank": 0
666
+ },
667
+ "bestVersusSeason": {
668
+ "trophies": 0,
669
+ "id": "string",
670
+ "rank": 0
671
+ },
672
+ "legendTrophies": 0,
673
+ "currentSeason": {
674
+ "trophies": 0,
675
+ "id": "string",
676
+ "rank": 0
677
+ },
678
+ "bestSeason": {
679
+ "trophies": 0,
680
+ "id": "string",
681
+ "rank": 0
682
+ }
683
+ },
684
+ "troops": [
685
+ {
686
+ "level": 0,
687
+ "name": {},
688
+ "maxLevel": 0,
689
+ "village": "string"
690
+ }
691
+ ],
692
+ "heroes": [
693
+ {
694
+ "level": 0,
695
+ "name": {},
696
+ "maxLevel": 0,
697
+ "village": "string"
698
+ }
699
+ ],
700
+ "spells": [
701
+ {
702
+ "level": 0,
703
+ "name": {},
704
+ "maxLevel": 0,
705
+ "village": "string"
706
+ }
707
+ ],
708
+ "role": "string",
709
+ "attackWins": 0,
710
+ "defenseWins": 0,
711
+ "townHallLevel": 0,
712
+ "labels": [
713
+ {
714
+ "name": {},
715
+ "id": 0,
716
+ "iconUrls": {}
717
+ }
718
+ ],
719
+ "tag": "string",
720
+ "name": "string",
721
+ "expLevel": 0,
722
+ "trophies": 0,
723
+ "bestTrophies": 0,
724
+ "donations": 0,
725
+ "donationsReceived": 0,
726
+ "builderHallLevel": 0,
727
+ "versusTrophies": 0,
728
+ "bestVersusTrophies": 0,
729
+ "warStars": 0,
730
+ "achievements": [
731
+ {
732
+ "stars": 0,
733
+ "value": 0,
734
+ "name": {},
735
+ "target": 0,
736
+ "info": {},
737
+ "completionInfo": {},
738
+ "village": "string"
739
+ }
740
+ ],
741
+ "versusBattleWinCount": 0
742
+ }
743
+ ```
744
+ </details>
745
+
746
+
747
+
748
+
749
+ ## Locations
750
+
751
+ ### All Locations Information
752
+ ```python
753
+ api.location()
754
+ ```
755
+ <details>
756
+ <summary>Click to view output</summary>
757
+
758
+ ```text
759
+ {"items":
760
+ [
761
+ {
762
+ "localizedName": "string",
763
+ "id": 0,
764
+ "name": "string",
765
+ "isCountry": true,
766
+ "countryCode": "string"
767
+ }
768
+ ],
769
+ "paging": {'cursors': {}}
770
+ }
771
+ ```
772
+ </details>
773
+
774
+ ### Information for a Single Location
775
+ ```python
776
+ api.location_id(location_tag) #for example "32000047"
777
+ ```
778
+
779
+ returns the above information for a single location
780
+
781
+ ### Top Clans in a Location
782
+ ```python
783
+ api.location_id_clan_rank(location_tag)
784
+ ```
785
+ Top 200 clans in a given location
786
+ <details>
787
+ <summary>Click to view output</summary>
788
+
789
+ ```text
790
+ {"items":
791
+ [
792
+ {
793
+ "clanLevel": 0,
794
+ "clanPoints": 0,
795
+ "location": {
796
+ "localizedName": "string",
797
+ "id": 0,
798
+ "name": "string",
799
+ "isCountry": true,
800
+ "countryCode": "string"
801
+ },
802
+ "members": 0,
803
+ "tag": "string",
804
+ "name": "string",
805
+ "rank": 0,
806
+ "previousRank": 0,
807
+ "badgeUrls": {}
808
+ }
809
+ ],
810
+ "paging": {'cursors': {}}
811
+ }
812
+ ```
813
+ </details>
814
+
815
+ ### Top Players in a Location
816
+ ```python
817
+ api.clan_leaguegroup(location_tag)
818
+ ```
819
+ Top 200 players in a given location
820
+ <details>
821
+ <summary>Click to view output</summary>
822
+
823
+ ```text
824
+ {"items":
825
+ [
826
+ {
827
+ "clan": {
828
+ "tag": "string",
829
+ "name": "string",
830
+ "badgeUrls": {}
831
+ },
832
+ "league": {
833
+ "name": {},
834
+ "id": 0,
835
+ "iconUrls": {}
836
+ },
837
+ "attackWins": 0,
838
+ "defenseWins": 0,
839
+ "tag": "string",
840
+ "name": "string",
841
+ "expLevel": 0,
842
+ "rank": 0,
843
+ "previousRank": 0,
844
+ "trophies": 0
845
+ }
846
+ ],
847
+ "paging": {'cursors': {}}
848
+ }
849
+ ```
850
+ </details>
851
+
852
+
853
+ ### Top Versus Clans in a Location
854
+ ```python
855
+ api.location_clan_versus(location_tag)
856
+ ```
857
+ Top 200 versus clans in a given location
858
+ <details>
859
+ <summary>Click to view output</summary>
860
+
861
+ ```text
862
+ {"items":
863
+ [
864
+ {
865
+ "clanPoints": 0,
866
+ "clanVersusPoints": 0
867
+ }
868
+ ],
869
+ "paging": {'cursors': {}}
870
+ }
871
+ ```
872
+ </details>
873
+
874
+
875
+ ### Top Versus Players in a Location
876
+ ```python
877
+ api.location_player_versus(location_tag)
878
+ ```
879
+ Top 200 versus players in a given location
880
+ <details>
881
+ <summary>Click to view output</summary>
882
+
883
+ ```text
884
+ {"items":
885
+ [
886
+ {
887
+ "clan": {
888
+ "tag": "string",
889
+ "name": "string",
890
+ "badgeUrls": {}
891
+ },
892
+ "versusBattleWins": 0,
893
+ "tag": "string",
894
+ "name": "string",
895
+ "expLevel": 0,
896
+ "rank": 0,
897
+ "previousRank": 0,
898
+ "versusTrophies": 0
899
+ }
900
+ ],
901
+ "paging": {'cursors': {}}
902
+ }
903
+ ```
904
+ </details>
905
+
906
+
907
+
908
+
909
+ ## Leagues
910
+
911
+ ### List leagues
912
+ ```python
913
+ api.league()
914
+ ```
915
+ <details>
916
+ <summary>Click to view output</summary>
917
+
918
+ ```text
919
+ {"items":
920
+ [
921
+ {
922
+ "name": {},
923
+ "id": 0,
924
+ "iconUrls": {}
925
+ }
926
+ ],
927
+ "paging": {'cursors': {}}
928
+ }
929
+ ```
930
+ </details>
931
+
932
+
933
+ ### League Information
934
+ ```python
935
+ api.league_id(league_tag)
936
+ ```
937
+ <details>
938
+ <summary>Click to view output</summary>
939
+
940
+ ```text
941
+ {
942
+ "name": {},
943
+ "id": 0,
944
+ "iconUrls": {}
945
+ }
946
+ ```
947
+ </details>
948
+
949
+
950
+ ### List Season Leagues
951
+ ```python
952
+ api.league_season(league_tag)
953
+ ```
954
+ Information is available only for Legend League
955
+ <details>
956
+ <summary>Click to view output</summary>
957
+
958
+ ```text
959
+ {"items":
960
+ [
961
+ {
962
+ "id": "string"
963
+ }
964
+ ],
965
+ "paging": {'cursors': {}}
966
+ }
967
+ ```
968
+ </details>
969
+
970
+
971
+ ### League Season Ranking
972
+ ```python
973
+ api.league_season_id(league_tag, season_tag)
974
+ ```
975
+ Information is available only for Legend League
976
+ <details>
977
+ <summary>Click to view output</summary>
978
+
979
+ ```text
980
+ {"items":
981
+ [
982
+ {
983
+ "clan": {
984
+ "tag": "string",
985
+ "name": "string",
986
+ "badgeUrls": {}
987
+ },
988
+ "league": {
989
+ "name": {},
990
+ "id": 0,
991
+ "iconUrls": {}
992
+ },
993
+ "attackWins": 0,
994
+ "defenseWins": 0,
995
+ "tag": "string",
996
+ "name": "string",
997
+ "expLevel": 0,
998
+ "rank": 0,
999
+ "previousRank": 0,
1000
+ "trophies": 0
1001
+ }
1002
+ ],
1003
+ "paging": {'cursors': {}}
1004
+ }
1005
+ ```
1006
+ </details>
1007
+
1008
+ ### List Capital Leagues
1009
+ ```python
1010
+ api.capitalleagues()
1011
+ ```
1012
+ <details>
1013
+ <summary>Click to view output</summary>
1014
+
1015
+ ```text
1016
+ {"items":
1017
+ [
1018
+ {
1019
+ "name": {},
1020
+ "id": 0,
1021
+ "iconUrls": {}
1022
+ }
1023
+ ],
1024
+ "paging": {'cursors': {}}
1025
+ }
1026
+ ```
1027
+ </details>
1028
+
1029
+ ### Capital League Information
1030
+ ```python
1031
+ api.capitalleagues_id(league_id)
1032
+ ```
1033
+ <details>
1034
+ <summary>Click to view output</summary>
1035
+
1036
+ ```text
1037
+ {
1038
+ "name": {},
1039
+ "id": 0,
1040
+ "iconUrls": {}
1041
+ }
1042
+ ```
1043
+ </details>
1044
+
1045
+ ### List Builder Base Leagues
1046
+ ```python
1047
+ api.builderbaseleagues()
1048
+ ```
1049
+ <details>
1050
+ <summary>Click to view output</summary>
1051
+
1052
+ ```text
1053
+ {"items":
1054
+ [
1055
+ {
1056
+ "name": {},
1057
+ "id": 0,
1058
+ "iconUrls": {}
1059
+ }
1060
+ ],
1061
+ "paging": {'cursors': {}}
1062
+ }
1063
+ ```
1064
+ </details>
1065
+
1066
+ ### Builder Base League Information
1067
+ ```python
1068
+ api.builderbaseleagues_id(league_id)
1069
+ ```
1070
+ <details>
1071
+ <summary>Click to view output</summary>
1072
+
1073
+ ```text
1074
+ {
1075
+ "name": {},
1076
+ "id": 0,
1077
+ "iconUrls": {}
1078
+ }
1079
+ ```
1080
+ </details>
1081
+
1082
+ ### List War Leagues
1083
+ ```python
1084
+ api.warleagues()
1085
+ ```
1086
+ <details>
1087
+ <summary>Click to view output</summary>
1088
+
1089
+ ```text
1090
+ {"items":
1091
+ [
1092
+ {
1093
+ "name": {},
1094
+ "id": 0,
1095
+ "iconUrls": {}
1096
+ }
1097
+ ],
1098
+ "paging": {'cursors': {}}
1099
+ }
1100
+ ```
1101
+ </details>
1102
+
1103
+ ### War League Information
1104
+ ```python
1105
+ api.warleagues_id(league_id)
1106
+ ```
1107
+ <details>
1108
+ <summary>Click to view output</summary>
1109
+
1110
+ ```text
1111
+ {
1112
+ "name": {},
1113
+ "id": 0,
1114
+ "iconUrls": {}
1115
+ }
1116
+ ```
1117
+ </details>
1118
+
1119
+
1120
+
1121
+
1122
+ ## Gold Pass
1123
+
1124
+ ### Current Gold Pass Season
1125
+ ```python
1126
+ api.goldpass_seasons_current()
1127
+ ```
1128
+ Get information about the current gold pass season
1129
+ <details>
1130
+ <summary>Click to view output</summary>
1131
+
1132
+ ```text
1133
+ {
1134
+ "startTime": "string",
1135
+ "endTime": "string"
1136
+ }
1137
+ ```
1138
+ </details>
1139
+
1140
+
1141
+ ## Labels
1142
+
1143
+ ### List Clan Labels
1144
+ ```python
1145
+ api.labels_clans()
1146
+ ```
1147
+ <details>
1148
+ <summary>Click to view output</summary>
1149
+
1150
+ ```text
1151
+ {"items":
1152
+ [
1153
+ {
1154
+ "name": {},
1155
+ "id": 0,
1156
+ "iconUrls": {}
1157
+ }
1158
+ ],
1159
+ "paging": {'cursors': {}}
1160
+ }
1161
+ ```
1162
+ </details>
1163
+
1164
+
1165
+ ### List Player Labels
1166
+ ```python
1167
+ api.labels_players()
1168
+ ```
1169
+ <details>
1170
+ <summary>Click to view output</summary>
1171
+
1172
+ ```text
1173
+ {"items":
1174
+ [
1175
+ {
1176
+ "name": {},
1177
+ "id": 0,
1178
+ "iconUrls": {}
1179
+ }
1180
+ ],
1181
+ "paging": {'cursors': {}}
1182
+ }
1183
+ ```
1184
+ </details>
1185
+
1186
+
1187
+ ## Credits
1188
+ - [All Contributors](../../contributors)
1189
+
1190
+ *Note versions below 2.0.0 are not supported anymore*
1191
+
1192
+ *DISCLAIMER: cocapi is not affiliated with SuperCell©.
@@ -1,7 +1,8 @@
1
1
  [project]
2
2
  name = "cocapi"
3
- version = "2.2.3"
3
+ version = "2.2.4"
4
4
  description = "A python wrapper around clash of clans api"
5
+ readme = "README.md"
5
6
  authors = [{name = "Tony Benoy", email = "me@tonybenoy.com"}]
6
7
  license = {text = "GPL-3.0"}
7
8
  requires-python = ">=3.7.2"
cocapi-2.2.3/PKG-INFO DELETED
@@ -1,25 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: cocapi
3
- Version: 2.2.3
4
- Summary: A python wrapper around clash of clans api
5
- Project-URL: Homepage, https://github.com/tonybenoy/cocapi
6
- Project-URL: Repository, https://github.com/tonybenoy/cocapi
7
- Project-URL: Issues, https://github.com/tonybenoy/cocapi/issues
8
- Author-email: Tony Benoy <me@tonybenoy.com>
9
- License: GPL-3.0
10
- License-File: LICENSE
11
- Keywords: api,clans,clash,supercell,wrapper
12
- Classifier: Development Status :: 5 - Production/Stable
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.7
17
- Classifier: Programming Language :: Python :: 3.8
18
- Classifier: Programming Language :: Python :: 3.9
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Requires-Python: >=3.7.2
23
- Requires-Dist: httpx<1.0.0,>=0.23.0
24
- Provides-Extra: pydantic
25
- Requires-Dist: pydantic>=2.0.0; extra == 'pydantic'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes