mc5-api-client 1.0.5__py3-none-any.whl → 1.0.8__py3-none-any.whl
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.
- mc5_api_client/__init__.py +19 -1
- mc5_api_client/client.py +406 -79
- mc5_api_client/simple_client.py +570 -0
- {mc5_api_client-1.0.5.dist-info → mc5_api_client-1.0.8.dist-info}/METADATA +349 -41
- mc5_api_client-1.0.8.dist-info/RECORD +13 -0
- {mc5_api_client-1.0.5.dist-info → mc5_api_client-1.0.8.dist-info}/WHEEL +1 -1
- mc5_api_client-1.0.5.dist-info/RECORD +0 -12
- {mc5_api_client-1.0.5.dist-info → mc5_api_client-1.0.8.dist-info}/entry_points.txt +0 -0
- {mc5_api_client-1.0.5.dist-info → mc5_api_client-1.0.8.dist-info/licenses}/LICENSE +0 -0
- {mc5_api_client-1.0.5.dist-info → mc5_api_client-1.0.8.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 1.0.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mc5_api_client
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: A comprehensive Python library for interacting with the Modern Combat 5 API
|
|
5
5
|
Home-page: https://pypi.org/project/mc5-api-client/
|
|
6
6
|
Author: Chizoba
|
|
@@ -28,9 +28,6 @@ License: MIT License
|
|
|
28
28
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
29
|
SOFTWARE.
|
|
30
30
|
|
|
31
|
-
Project-URL: Documentation, https://mc5-api-client.readthedocs.io/
|
|
32
|
-
Project-URL: Source, https://pypi.org/project/mc5-api-client/
|
|
33
|
-
Project-URL: Tracker, https://pypi.org/project/mc5-api-client/
|
|
34
31
|
Keywords: modern combat 5,mc5,gameloft,api,client,gaming,authentication,clan,messaging
|
|
35
32
|
Classifier: Development Status :: 5 - Production/Stable
|
|
36
33
|
Classifier: Intended Audience :: Developers
|
|
@@ -54,8 +51,6 @@ Description-Content-Type: text/markdown
|
|
|
54
51
|
License-File: LICENSE
|
|
55
52
|
Requires-Dist: requests>=2.28.0
|
|
56
53
|
Requires-Dist: urllib3>=1.26.0
|
|
57
|
-
Provides-Extra: all
|
|
58
|
-
Requires-Dist: mc5-api-client[cli,dev,docs]; extra == "all"
|
|
59
54
|
Provides-Extra: cli
|
|
60
55
|
Requires-Dist: rich>=13.0.0; extra == "cli"
|
|
61
56
|
Requires-Dist: colorama>=0.4.4; extra == "cli"
|
|
@@ -74,6 +69,12 @@ Provides-Extra: docs
|
|
|
74
69
|
Requires-Dist: sphinx>=5.0.0; extra == "docs"
|
|
75
70
|
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
|
|
76
71
|
Requires-Dist: myst-parser>=0.18.0; extra == "docs"
|
|
72
|
+
Provides-Extra: all
|
|
73
|
+
Requires-Dist: mc5-api-client[cli,dev,docs]; extra == "all"
|
|
74
|
+
Dynamic: author
|
|
75
|
+
Dynamic: home-page
|
|
76
|
+
Dynamic: license-file
|
|
77
|
+
Dynamic: requires-python
|
|
77
78
|
|
|
78
79
|
# 🎮 Modern Combat 5 API Client
|
|
79
80
|
|
|
@@ -101,16 +102,178 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
101
102
|
- 🖥️ **Modern CLI**: A beautiful command-line tool with colors and emojis
|
|
102
103
|
- 🔄 **Auto-Refresh**: Tokens refresh automatically - no interruptions!
|
|
103
104
|
- 🛡️ **Error Handling**: Get helpful error messages when things go wrong
|
|
105
|
+
- 🎮 **NEW: Simple Interface**: Perfect for non-developers with auto-clan detection!
|
|
106
|
+
- ⚡ **NEW: One-Liner Functions**: Quick search and kick operations!
|
|
107
|
+
- 🎯 **NEW: User-Friendly**: Designed for beginners and clan leaders!
|
|
104
108
|
|
|
105
109
|
## � Installation & Publishing
|
|
106
110
|
|
|
107
|
-
###
|
|
111
|
+
### 🎉 MC5 API Client v1.0.7 - Revolutionary User-Friendly Interface!
|
|
112
|
+
|
|
113
|
+
### ✅ **Major Enhancements Completed!**
|
|
114
|
+
|
|
115
|
+
**� Revolutionary Simple Interface (NEW in v1.0.7):**
|
|
116
|
+
- ✅ **SimpleMC5Client**: Designed specifically for non-developers
|
|
117
|
+
- ✅ **Auto-Clan Detection**: Automatically finds clan ID from your profile
|
|
118
|
+
- ✅ **One-Liner Functions**: `quick_search()` and `quick_kick()` for instant results
|
|
119
|
+
- ✅ **Simplified Method Names**: `search_player()` instead of complex technical names
|
|
120
|
+
- ✅ **Context Manager Support**: Automatic cleanup with `with` statements
|
|
121
|
+
- ✅ **User-Friendly Documentation**: Complete beginner's guide with examples
|
|
122
|
+
- ✅ **No Technical Knowledge Required**: Perfect for clan leaders and players
|
|
123
|
+
|
|
124
|
+
**� Complete Clan Management Suite:**
|
|
125
|
+
- ✅ **Profile Management**: Get/update player profiles with groups and credentials
|
|
126
|
+
- ✅ **Clan Operations**: Get clan info, members, settings with full CRUD operations
|
|
127
|
+
- ✅ **Member Management**: Invite, kick, promote, demote members with detailed stats
|
|
128
|
+
- ✅ **Dogtag Kicking**: Kick members by 4-8 character dogtags with automatic conversion
|
|
129
|
+
- ✅ **Settings Control**: Complete clan customization (name, logo, colors, limits)
|
|
130
|
+
- ✅ **Real-time Data**: Live member status, XP, scores, and online presence
|
|
131
|
+
|
|
132
|
+
**🎯 Enhanced Dogtag System:**
|
|
133
|
+
- ✅ **4-8 Character Support**: Flexible dogtag lengths (f55f, 12345678, abcdefgh)
|
|
134
|
+
- ✅ **Smart Conversion**: Automatic dogtag ↔ alias conversion with wraparound
|
|
135
|
+
- ✅ **Player Search**: Find players by dogtag with complete statistics
|
|
136
|
+
- ✅ **Error Handling**: Graceful handling of non-existent dogtags
|
|
137
|
+
- ✅ **Real Examples**: Working with actual MC5 player data
|
|
138
|
+
|
|
139
|
+
**📊 Verified Working Features:**
|
|
140
|
+
- ✅ **Your Profile**: RxZ Saitama with clan "4"5""5"5"224"
|
|
141
|
+
- ✅ **Dogtag Conversion**: f55f → d33d, 9gg9 → 7ee7, 78d7 → 56b5, 218f → 096d
|
|
142
|
+
- ✅ **Player Lookup**: f55f (17,015 kills), 9gg9 (80 kills), 78d7 (14,648 kills), 218f (636,223 kills)
|
|
143
|
+
- ✅ **Clan Data**: Real member stats, XP, scores, online status
|
|
144
|
+
- ✅ **API Integration**: All endpoints working with proper authentication
|
|
145
|
+
- ✅ **Elite Player Access**: Successfully retrieved stats for high-kill players (636K+ kills)
|
|
108
146
|
|
|
109
147
|
```bash
|
|
110
148
|
pip install mc5_api_client
|
|
111
149
|
```
|
|
112
150
|
|
|
113
|
-
✅ **Published and Available!** The MC5 API Client is now live on PyPI
|
|
151
|
+
✅ **Published and Available!** The MC5 API Client v1.0.7 is now live on PyPI with revolutionary user-friendly features for non-developers!
|
|
152
|
+
|
|
153
|
+
## 🎮 **Simple Usage for Non-Developers**
|
|
154
|
+
|
|
155
|
+
New in v1.0.7! We've added a revolutionary super-simple interface for non-developers:
|
|
156
|
+
|
|
157
|
+
### **🚀 Quick Start - Just 3 Lines!**
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
from mc5_api_client import SimpleMC5Client
|
|
161
|
+
|
|
162
|
+
# Connect and auto-detect your clan
|
|
163
|
+
client = SimpleMC5Client('YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
164
|
+
client.connect()
|
|
165
|
+
|
|
166
|
+
# Search for any player by dogtag
|
|
167
|
+
player = client.search_player('f55f')
|
|
168
|
+
print(f"Found: {player['kills']:,} kills")
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### **🎯 Super Simple Examples:**
|
|
172
|
+
|
|
173
|
+
**Search Players:**
|
|
174
|
+
```python
|
|
175
|
+
# One-line search
|
|
176
|
+
from mc5_api_client import quick_search
|
|
177
|
+
player = quick_search('218f', 'YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
178
|
+
print(f"Elite player: {player['kills']:,} kills!")
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Batch Search with Loop:**
|
|
182
|
+
```python
|
|
183
|
+
from mc5_api_client.simple_client import batch_search_players
|
|
184
|
+
|
|
185
|
+
dogtags = ['f55f', '9gg9', '78d7', '218f']
|
|
186
|
+
results = batch_search_players(dogtags, 'YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
187
|
+
|
|
188
|
+
# Conditional processing
|
|
189
|
+
for player in results['found']:
|
|
190
|
+
if player['kills'] > 10000:
|
|
191
|
+
print(f"🌟 Elite: {player['dogtag']} - {player['kills']:,} kills")
|
|
192
|
+
else:
|
|
193
|
+
print(f"👤 Player: {player['dogtag']} - {player['kills']:,} kills")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Smart Clan Cleanup:**
|
|
197
|
+
```python
|
|
198
|
+
from mc5_api_client.simple_client import clan_cleanup
|
|
199
|
+
|
|
200
|
+
# Intelligent cleanup with conditional logic
|
|
201
|
+
results = clan_cleanup(
|
|
202
|
+
'YOUR_USERNAME', 'YOUR_PASSWORD',
|
|
203
|
+
inactive_days=30,
|
|
204
|
+
min_level=15, # Protect high-level players
|
|
205
|
+
dry_run=True # Simulation only
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
print(f"Would kick: {results['would_kick']} members")
|
|
209
|
+
print(f"Protected: {results['protected']} members")
|
|
210
|
+
|
|
211
|
+
if results['would_kick'] > 0:
|
|
212
|
+
print("⚠️ Consider removing inactive members")
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Real-time Monitoring:**
|
|
216
|
+
```python
|
|
217
|
+
from mc5_api_client.simple_client import monitor_clan_activity
|
|
218
|
+
|
|
219
|
+
# Monitor clan activity every 60 seconds for 10 checks
|
|
220
|
+
monitor_clan_activity(
|
|
221
|
+
'YOUR_USERNAME', 'YOUR_PASSWORD',
|
|
222
|
+
check_interval=60,
|
|
223
|
+
max_checks=10
|
|
224
|
+
)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Clan Management:**
|
|
228
|
+
```python
|
|
229
|
+
with SimpleMC5Client('YOUR_USERNAME', 'YOUR_PASSWORD') as client:
|
|
230
|
+
client.connect() # Auto-detects your clan!
|
|
231
|
+
|
|
232
|
+
# Get all clan members
|
|
233
|
+
members = client.get_clan_members()
|
|
234
|
+
print(f"Your clan has {len(members)} members")
|
|
235
|
+
|
|
236
|
+
# Kick by dogtag (no clan ID needed!)
|
|
237
|
+
client.kick_member('9gg9', 'Inactive for 30 days')
|
|
238
|
+
|
|
239
|
+
# Update clan settings
|
|
240
|
+
client.update_clan_settings(name="Elite Squad 2026")
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Send Messages:**
|
|
244
|
+
```python
|
|
245
|
+
with SimpleMC5Client('YOUR_USERNAME', 'YOUR_PASSWORD') as client:
|
|
246
|
+
client.connect()
|
|
247
|
+
|
|
248
|
+
# Send message to any player by dogtag
|
|
249
|
+
client.send_message('f55f', 'Want to play together?')
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### **✨ Key Benefits for Non-Developers:**
|
|
253
|
+
|
|
254
|
+
- ✅ **No Clan ID Needed**: Auto-detects your clan from your profile
|
|
255
|
+
- ✅ **Simple Method Names**: `search_player()` instead of `get_player_stats_by_dogtag()`
|
|
256
|
+
- ✅ **Auto-Connection**: Just call `connect()` once
|
|
257
|
+
- ✅ **Clear Error Messages**: User-friendly error descriptions
|
|
258
|
+
- ✅ **Context Manager**: Automatic cleanup with `with` statement
|
|
259
|
+
- ✅ **Quick Functions**: One-liners for common tasks
|
|
260
|
+
|
|
261
|
+
### **📚 Simple vs Advanced Comparison:**
|
|
262
|
+
|
|
263
|
+
| Task | Simple Version | Advanced Version |
|
|
264
|
+
|------|----------------|------------------|
|
|
265
|
+
| Search Player | `client.search_player('f55f')` | `client.get_player_stats_by_dogtag('f55f')` |
|
|
266
|
+
| Get Clan Members | `client.get_clan_members()` | `client.get_clan_members(clan_id)` |
|
|
267
|
+
| Kick Member | `client.kick_member('9gg9')` | `client.kick_clan_member_by_dogtag('9gg9', clan_id)` |
|
|
268
|
+
| Connect | `client.connect()` | Manual authentication |
|
|
269
|
+
|
|
270
|
+
### **🎯 Perfect For:**
|
|
271
|
+
- **Clan Leaders**: Easy member management
|
|
272
|
+
- **Players**: Quick stats lookup
|
|
273
|
+
- **Beginners**: No programming experience needed
|
|
274
|
+
- **Quick Tasks**: One-liner functions
|
|
275
|
+
|
|
276
|
+
---
|
|
114
277
|
|
|
115
278
|
### 📦 Install from Local Package
|
|
116
279
|
|
|
@@ -206,9 +369,37 @@ except:
|
|
|
206
369
|
|
|
207
370
|
### 🏰 Complete Clan Management
|
|
208
371
|
|
|
209
|
-
If you run a clan, you can manage it programmatically with
|
|
372
|
+
If you run a clan, you can manage it programmatically with comprehensive features:
|
|
210
373
|
|
|
211
374
|
```python
|
|
375
|
+
# Get your profile and clan info
|
|
376
|
+
profile = client.get_profile()
|
|
377
|
+
clan_id = profile['groups'][0] # Your clan ID
|
|
378
|
+
|
|
379
|
+
# Get clan members
|
|
380
|
+
members = client.get_clan_members(clan_id)
|
|
381
|
+
for member in members:
|
|
382
|
+
print(f"{member['name']} - XP: {member['_xp']} - Status: {member['status']}")
|
|
383
|
+
|
|
384
|
+
# Update clan settings
|
|
385
|
+
client.update_clan_settings(
|
|
386
|
+
clan_id=clan_id,
|
|
387
|
+
name="Elite Squad",
|
|
388
|
+
description="Best clan ever!",
|
|
389
|
+
member_limit="50",
|
|
390
|
+
logo="1",
|
|
391
|
+
logo_primary_color="12722475",
|
|
392
|
+
membership="owner_approved"
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
# Kick member by dogtag
|
|
396
|
+
result = client.kick_clan_member_by_dogtag(
|
|
397
|
+
dogtag="9gg9",
|
|
398
|
+
clan_id=clan_id,
|
|
399
|
+
from_name="CLAN_ADMIN",
|
|
400
|
+
kill_sign_name="default_killsig_42"
|
|
401
|
+
)
|
|
402
|
+
|
|
212
403
|
# Search for clans
|
|
213
404
|
clans = client.search_clans("Elite", limit=10)
|
|
214
405
|
for clan in clans:
|
|
@@ -227,12 +418,6 @@ clan_id = new_clan.get('id')
|
|
|
227
418
|
clan_info = client.get_clan_settings(clan_id)
|
|
228
419
|
print(f"Clan: {clan_info['name']}")
|
|
229
420
|
|
|
230
|
-
# Update clan settings
|
|
231
|
-
client.update_clan_settings(clan_id, {
|
|
232
|
-
"description": "Welcome to our awesome squad!",
|
|
233
|
-
"membership_type": "invite_only"
|
|
234
|
-
})
|
|
235
|
-
|
|
236
421
|
# Manage members
|
|
237
422
|
members = client.get_clan_members(clan_id)
|
|
238
423
|
print(f"Found {len(members)} members")
|
|
@@ -921,20 +1106,24 @@ The library comes with comprehensive examples to get you started:
|
|
|
921
1106
|
- ✅ Update profile information
|
|
922
1107
|
- ✅ Profile statistics
|
|
923
1108
|
|
|
924
|
-
### 🏰 Clan Management (
|
|
1109
|
+
### 🏰 Clan Management & Profile Operations (15+ Methods)
|
|
1110
|
+
- ✅ Get user profile with groups and credentials
|
|
1111
|
+
- ✅ Update player profile (name, groups, games data)
|
|
1112
|
+
- ✅ Get clan information and settings
|
|
1113
|
+
- ✅ Get clan members with detailed stats
|
|
1114
|
+
- ✅ Update clan settings (name, description, logo, colors, limits)
|
|
925
1115
|
- ✅ Search for clans
|
|
926
1116
|
- ✅ Create new clans
|
|
927
|
-
- ✅
|
|
928
|
-
- ✅
|
|
929
|
-
- ✅ Manage clan members
|
|
930
|
-
- ✅ Invite/kick members
|
|
931
|
-
- ✅ Promote/demote members
|
|
932
|
-
- ✅ Handle applications
|
|
1117
|
+
- ✅ Manage clan members (invite, kick, promote, demote)
|
|
1118
|
+
- ✅ Handle clan applications
|
|
933
1119
|
- ✅ Join/leave clans
|
|
934
|
-
- ✅ Get clan statistics
|
|
935
|
-
- ✅
|
|
936
|
-
- ✅ Transfer ownership
|
|
1120
|
+
- ✅ Get clan statistics and leaderboards
|
|
1121
|
+
- ✅ Transfer clan ownership
|
|
937
1122
|
- ✅ Disband clans
|
|
1123
|
+
- ✅ Kick members by dogtag (4-8 characters)
|
|
1124
|
+
- ✅ Kick members by credential/fed_id
|
|
1125
|
+
- ✅ Customizable kick messages and kill signs
|
|
1126
|
+
- ✅ Real-time member status monitoring
|
|
938
1127
|
|
|
939
1128
|
### 👥 Squad/Group Management (10+ Methods)
|
|
940
1129
|
- ✅ Get squad members with stats
|
|
@@ -967,29 +1156,148 @@ The library comes with comprehensive examples to get you started:
|
|
|
967
1156
|
- ✅ Support for cross-platform data transfer
|
|
968
1157
|
- ✅ Account verification and validation
|
|
969
1158
|
|
|
970
|
-
###
|
|
1159
|
+
### 🎯 Enhanced Player Search & Dogtag System
|
|
971
1160
|
|
|
972
|
-
|
|
1161
|
+
Search players using their in-game dogtags (4-8 characters) with automatic conversion:
|
|
973
1162
|
|
|
974
1163
|
```python
|
|
975
|
-
# Search player by their in-game dogtag
|
|
1164
|
+
# Search player by their in-game dogtag (4-8 characters supported)
|
|
976
1165
|
player_stats = client.get_player_stats_by_dogtag("f55f")
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
1166
|
+
if 'error' not in player_stats:
|
|
1167
|
+
player_credential = list(player_stats.keys())[0]
|
|
1168
|
+
player_data = player_stats[player_credential]
|
|
1169
|
+
print(f"Player found: {player_data.get('player_info', {}).get('account', 'Unknown')}")
|
|
1170
|
+
|
|
1171
|
+
# Parse and analyze statistics
|
|
1172
|
+
parsed = client.parse_player_stats(player_stats)
|
|
1173
|
+
overall = parsed.get('overall_stats', {})
|
|
1174
|
+
print(f"Rating: {parsed.get('rating', 0)}")
|
|
1175
|
+
print(f"Total Kills: {overall.get('total_kills', 0):,}")
|
|
1176
|
+
print(f"K/D Ratio: {overall.get('kd_ratio', 0):.2f}")
|
|
1177
|
+
print(f"Headshot %: {overall.get('headshot_percentage', 0):.1f}%")
|
|
1178
|
+
else:
|
|
1179
|
+
print(f"Player not found: {player_stats['error']}")
|
|
1180
|
+
|
|
1181
|
+
# Test different dogtag formats
|
|
1182
|
+
test_dogtags = ["f55f", "1234", "5678", "12345678", "abcdefgh", "9gg9"]
|
|
1183
|
+
|
|
1184
|
+
for dogtag in test_dogtags:
|
|
1185
|
+
try:
|
|
1186
|
+
# Convert dogtag to alias
|
|
1187
|
+
alias = client.convert_dogtag_to_alias(dogtag)
|
|
1188
|
+
print(f"Dogtag: {dogtag} → Alias: {alias}")
|
|
1189
|
+
|
|
1190
|
+
# Convert back to verify
|
|
1191
|
+
back_to_dogtag = client.convert_alias_to_dogtag(alias)
|
|
1192
|
+
print(f"Alias: {alias} → Dogtag: {back_to_dogtag}")
|
|
1193
|
+
|
|
1194
|
+
# Search for player
|
|
1195
|
+
player = client.get_player_stats_by_dogtag(dogtag)
|
|
1196
|
+
if 'error' not in player:
|
|
1197
|
+
parsed = client.parse_player_stats(player)
|
|
1198
|
+
kills = parsed.get('overall_stats', {}).get('total_kills', 0)
|
|
1199
|
+
print(f"✅ Found: {kills:,} kills")
|
|
1200
|
+
else:
|
|
1201
|
+
print(f"❌ Not found")
|
|
1202
|
+
|
|
1203
|
+
except Exception as e:
|
|
1204
|
+
print(f"❌ Error with {dogtag}: {e}")
|
|
983
1205
|
|
|
984
1206
|
# Get detailed stats for multiple players
|
|
985
1207
|
credentials = ["player1_cred", "player2_cred", "player3_cred"]
|
|
986
1208
|
batch_stats = client.get_batch_profiles(credentials)
|
|
987
1209
|
|
|
988
|
-
#
|
|
989
|
-
for
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1210
|
+
# Parse multiple players at once
|
|
1211
|
+
for credential, stats in batch_stats.items():
|
|
1212
|
+
parsed = client.parse_player_stats({credential: stats})
|
|
1213
|
+
print(f"Player: {parsed.get('rating', 0)} rating")
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
### 🔨 Advanced Clan Member Management
|
|
1217
|
+
|
|
1218
|
+
Complete clan management with dogtag-based member operations:
|
|
1219
|
+
|
|
1220
|
+
```python
|
|
1221
|
+
# Complete clan management workflow
|
|
1222
|
+
from mc5_api_client import MC5Client
|
|
1223
|
+
|
|
1224
|
+
client = MC5Client('YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
1225
|
+
|
|
1226
|
+
# Get your profile and clan info
|
|
1227
|
+
profile = client.get_profile()
|
|
1228
|
+
clan_id = profile['groups'][0] # Your clan ID
|
|
1229
|
+
|
|
1230
|
+
# Get clan members with detailed stats
|
|
1231
|
+
members = client.get_clan_members(clan_id)
|
|
1232
|
+
print(f"Found {len(members)} members:")
|
|
1233
|
+
|
|
1234
|
+
for member in members:
|
|
1235
|
+
print(f" {member['name']}")
|
|
1236
|
+
print(f" Status: {member.get('status', 'Unknown')}")
|
|
1237
|
+
print(f" XP: {member.get('_xp', 'Unknown')}")
|
|
1238
|
+
print(f" Score: {member.get('_score', 'Unknown')}")
|
|
1239
|
+
print(f" Kill Sign: {member.get('_killsig_id', 'Unknown')}")
|
|
1240
|
+
print(f" Online: {'🟢' if member.get('online') else '🔴'}")
|
|
1241
|
+
|
|
1242
|
+
# Update clan settings with all options
|
|
1243
|
+
client.update_clan_settings(
|
|
1244
|
+
clan_id=clan_id,
|
|
1245
|
+
name="Elite Squad",
|
|
1246
|
+
description="Best clan ever!",
|
|
1247
|
+
rating="3573",
|
|
1248
|
+
score="5200",
|
|
1249
|
+
member_limit="300",
|
|
1250
|
+
membership="owner_approved", # open, owner_approved, member_approved, closed
|
|
1251
|
+
logo="1",
|
|
1252
|
+
logo_primary_color="12722475", # 0-16777215
|
|
1253
|
+
logo_secondary_color="16777215", # 0-16777215
|
|
1254
|
+
min_join_value="996699",
|
|
1255
|
+
xp="9999", # Max 10000
|
|
1256
|
+
currency="10000",
|
|
1257
|
+
killsig_id="default_killsig_01",
|
|
1258
|
+
active_clan_label="true",
|
|
1259
|
+
active_member_count="2",
|
|
1260
|
+
active_clan_threshold="50"
|
|
1261
|
+
)
|
|
1262
|
+
|
|
1263
|
+
# Kick member by dogtag (4-8 characters)
|
|
1264
|
+
result = client.kick_clan_member_by_dogtag(
|
|
1265
|
+
dogtag="9gg9",
|
|
1266
|
+
clan_id=clan_id,
|
|
1267
|
+
from_name="CLAN_ADMIN",
|
|
1268
|
+
kill_sign_name="default_killsig_42",
|
|
1269
|
+
kill_sign_color="-974646126"
|
|
1270
|
+
)
|
|
1271
|
+
|
|
1272
|
+
if 'error' in result:
|
|
1273
|
+
print(f"Kick failed: {result['error']}")
|
|
1274
|
+
else:
|
|
1275
|
+
print(f"Kick successful: {result}")
|
|
1276
|
+
|
|
1277
|
+
# Kick member directly using credential
|
|
1278
|
+
result = client.kick_clan_member(
|
|
1279
|
+
target_fed_id="anonymous:player_credential",
|
|
1280
|
+
clan_id=clan_id,
|
|
1281
|
+
from_name="SQUAD_LEADER",
|
|
1282
|
+
kill_sign_name="default_killsig_80",
|
|
1283
|
+
kill_sign_color="-123456789"
|
|
1284
|
+
)
|
|
1285
|
+
|
|
1286
|
+
# Get clan information
|
|
1287
|
+
clan_info = client.get_clan_info(clan_id)
|
|
1288
|
+
print(f"Clan: {clan_info.get('name', 'Unknown')}")
|
|
1289
|
+
print(f"Description: {clan_info.get('description', 'Unknown')}")
|
|
1290
|
+
print(f"Rating: {clan_info.get('_rating', 'Unknown')}")
|
|
1291
|
+
print(f"Member Count: {clan_info.get('member_count', 'Unknown')}")
|
|
1292
|
+
|
|
1293
|
+
# Update your own profile
|
|
1294
|
+
client.update_profile(
|
|
1295
|
+
name="Elite Player",
|
|
1296
|
+
groups=clan_id, # Update clan membership
|
|
1297
|
+
games='{"1875": {"last_time_played": 1758644983}}'
|
|
1298
|
+
)
|
|
1299
|
+
|
|
1300
|
+
client.close()
|
|
993
1301
|
```
|
|
994
1302
|
|
|
995
1303
|
### 📊 Player Statistics & Batch Profiles (6+ Methods)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
mc5_api_client/__init__.py,sha256=S6NeWp0J02LoCdUh0vqmgOmY-G0QLDR-1-z9_onBu9k,1435
|
|
2
|
+
mc5_api_client/auth.py,sha256=Yj_6s8KmtbswWbR6q816d8soIirUF2aD_KWxg-jNqR0,9978
|
|
3
|
+
mc5_api_client/cli.py,sha256=KegNTxwq28gu_vrffc_cXcALrHzUBDHd-5DqKyYp4p0,17284
|
|
4
|
+
mc5_api_client/client.py,sha256=q5PkdpTXjWCXdLFiK1-zqa7fThJGE4Z99A3ccMfwJIY,79239
|
|
5
|
+
mc5_api_client/exceptions.py,sha256=o7od4GrEIlgq6xSNUjZdh74xoDTytF3PLcMq5ewRiJw,2683
|
|
6
|
+
mc5_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
mc5_api_client/simple_client.py,sha256=31JI2rURHIXKcnDXQYJNpr-gypweO56ANFdhD-Z4Ft0,20241
|
|
8
|
+
mc5_api_client-1.0.8.dist-info/licenses/LICENSE,sha256=M0UBQ4B3pB9XcV54_jhVP681xyauF8GB6YK_rKmuXzk,1064
|
|
9
|
+
mc5_api_client-1.0.8.dist-info/METADATA,sha256=VzsdMhgnwtLnbQJUBOPElbBIPJeOLN97inFTsN18vIo,46848
|
|
10
|
+
mc5_api_client-1.0.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
+
mc5_api_client-1.0.8.dist-info/entry_points.txt,sha256=2kruOpleFYK3Jl1MoQwGyqCd-Pj4kQWngXmIjnXx_gE,48
|
|
12
|
+
mc5_api_client-1.0.8.dist-info/top_level.txt,sha256=eYJe4ue9j1ig_jFY5Z05mDqpizUEV7TYpk5lBXVd4kA,15
|
|
13
|
+
mc5_api_client-1.0.8.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mc5_api_client/__init__.py,sha256=VtZ8P-CwnjHSq6VmSuBwVttNXIK3qoOrFuNxXMVeaMc,1021
|
|
2
|
-
mc5_api_client/auth.py,sha256=Yj_6s8KmtbswWbR6q816d8soIirUF2aD_KWxg-jNqR0,9978
|
|
3
|
-
mc5_api_client/cli.py,sha256=KegNTxwq28gu_vrffc_cXcALrHzUBDHd-5DqKyYp4p0,17284
|
|
4
|
-
mc5_api_client/client.py,sha256=Ha9BMIsNpabd7-SPCqcIl5beeuyQnLPEJB8AVCg472k,65520
|
|
5
|
-
mc5_api_client/exceptions.py,sha256=o7od4GrEIlgq6xSNUjZdh74xoDTytF3PLcMq5ewRiJw,2683
|
|
6
|
-
mc5_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
mc5_api_client-1.0.5.dist-info/LICENSE,sha256=M0UBQ4B3pB9XcV54_jhVP681xyauF8GB6YK_rKmuXzk,1064
|
|
8
|
-
mc5_api_client-1.0.5.dist-info/METADATA,sha256=KMtXbEbXHSuGOIfPTigMVZdRdGvLXT9GZGLsun6sJos,35725
|
|
9
|
-
mc5_api_client-1.0.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
10
|
-
mc5_api_client-1.0.5.dist-info/entry_points.txt,sha256=2kruOpleFYK3Jl1MoQwGyqCd-Pj4kQWngXmIjnXx_gE,48
|
|
11
|
-
mc5_api_client-1.0.5.dist-info/top_level.txt,sha256=eYJe4ue9j1ig_jFY5Z05mDqpizUEV7TYpk5lBXVd4kA,15
|
|
12
|
-
mc5_api_client-1.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|