mc5-api-client 1.0.13__tar.gz → 1.0.15__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.
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/PKG-INFO +138 -94
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/README.md +137 -93
- mc5_api_client-1.0.15/examples/admin_tools.py +342 -0
- mc5_api_client-1.0.15/examples/everyday_mc5.py +152 -0
- mc5_api_client-1.0.15/examples/quick_reference.py +189 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/pyproject.toml +1 -1
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/__init__.py +1 -1
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/cli.py +1 -1
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/PKG-INFO +138 -94
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/SOURCES.txt +3 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/.gitignore +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/CHANGELOG.md +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/LICENSE +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/MANIFEST.in +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/admin_squad_management.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/advanced_automation.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/advanced_features.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/basic_usage.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/clan_management.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/clan_management_complete.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/events_and_tasks.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/help_system.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/message_management.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/player_stats.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/private_messaging.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/quick_help.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/simple_usage.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/squad_management.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/examples/squad_wall_management.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/pytest.ini +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/requirements-dev.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/requirements.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/setup.cfg +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/setup.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/admin_client.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/auth.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/client.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/exceptions.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/help.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/py.typed +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client/simple_client.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/requires.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/src/mc5_api_client.egg-info/top_level.txt +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/tests/__init__.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/tests/test_auth.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/tests/test_cli.py +0 -0
- {mc5_api_client-1.0.13 → mc5_api_client-1.0.15}/tests/test_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.15
|
|
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
|
|
@@ -188,9 +188,12 @@ result = quick_update_player_score(
|
|
|
188
188
|
)
|
|
189
189
|
|
|
190
190
|
if result.get('success'):
|
|
191
|
-
print("✅ Player score updated successfully!")
|
|
192
|
-
print(f"New score: {result.get('
|
|
193
|
-
|
|
191
|
+
print(f"✅ Player score updated successfully!")
|
|
192
|
+
print(f"New score: {result.get('score_updated')}")
|
|
193
|
+
if result.get('xp_updated'):
|
|
194
|
+
print(f"New XP: {result.get('xp_updated')}")
|
|
195
|
+
else:
|
|
196
|
+
print(f"❌ Error: {result.get('error', 'Unknown error')}")
|
|
194
197
|
```
|
|
195
198
|
|
|
196
199
|
### **� Admin Client Usage:**
|
|
@@ -229,130 +232,169 @@ client.close()
|
|
|
229
232
|
### **🔧 How It Actually Works:**
|
|
230
233
|
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
231
234
|
|
|
232
|
-
##
|
|
233
|
-
|
|
234
|
-
New in v1.0.7! We've added a revolutionary super-simple interface for non-developers:
|
|
235
|
+
## � **Quick Start - What Most Users Want**
|
|
235
236
|
|
|
236
|
-
### **🚀
|
|
237
|
+
### **🚀 Everyday MC5 Tasks (3 Lines)**
|
|
237
238
|
|
|
238
239
|
```python
|
|
239
240
|
from mc5_api_client import SimpleMC5Client
|
|
240
241
|
|
|
241
|
-
# Connect and
|
|
242
|
+
# Connect and check your daily tasks
|
|
242
243
|
client = SimpleMC5Client('YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
243
244
|
client.connect()
|
|
244
245
|
|
|
245
|
-
#
|
|
246
|
-
|
|
247
|
-
print(f"
|
|
246
|
+
# Check your profile
|
|
247
|
+
profile = client.client.get_profile()
|
|
248
|
+
print(f"Level: {profile['level']}, Score: {profile['score']:,}")
|
|
248
249
|
```
|
|
249
250
|
|
|
250
|
-
###
|
|
251
|
+
### **� Search Players Instantly**
|
|
251
252
|
|
|
252
|
-
**Search Players:**
|
|
253
253
|
```python
|
|
254
|
-
# One-line search
|
|
254
|
+
# One-line player search
|
|
255
255
|
from mc5_api_client import quick_search
|
|
256
|
-
player = quick_search('
|
|
256
|
+
player = quick_search('f55f', 'YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
257
257
|
print(f"Elite player: {player['kills']:,} kills!")
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
### **🛡️ Admin Score Updates (Working Example)**
|
|
261
|
+
|
|
261
262
|
```python
|
|
262
|
-
from mc5_api_client
|
|
263
|
+
from mc5_api_client import quick_update_player_score
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
# Add 5200 rating to squad by updating player score
|
|
266
|
+
result = quick_update_player_score(
|
|
267
|
+
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
268
|
+
score=5200,
|
|
269
|
+
xp=2037745,
|
|
270
|
+
killsig_color="-974646126",
|
|
271
|
+
killsig_id="default_killsig_80"
|
|
272
|
+
)
|
|
266
273
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
else:
|
|
272
|
-
print(f"👤 Player: {player['dogtag']} - {player['kills']:,} kills")
|
|
274
|
+
if result.get('success'):
|
|
275
|
+
print(f"✅ Score updated: {result.get('score_updated')}")
|
|
276
|
+
else:
|
|
277
|
+
print(f"❌ Error: {result.get('error', 'Unknown error')}")
|
|
273
278
|
```
|
|
274
279
|
|
|
275
|
-
**
|
|
276
|
-
```python
|
|
277
|
-
from mc5_api_client.simple_client import clan_cleanup
|
|
278
|
-
|
|
279
|
-
# Intelligent cleanup with conditional logic
|
|
280
|
-
results = clan_cleanup(
|
|
281
|
-
'YOUR_USERNAME', 'YOUR_PASSWORD',
|
|
282
|
-
inactive_days=30,
|
|
283
|
-
min_level=15, # Protect high-level players
|
|
284
|
-
dry_run=True # Simulation only
|
|
285
|
-
)
|
|
280
|
+
## � **Examples Folder - Ready-to-Use Scripts**
|
|
286
281
|
|
|
287
|
-
|
|
288
|
-
print(f"Protected: {results['protected']} members")
|
|
282
|
+
New in v1.0.14! We've created practical, ready-to-use scripts for common MC5 tasks:
|
|
289
283
|
|
|
290
|
-
|
|
291
|
-
|
|
284
|
+
### **🎮 Everyday MC5 Tasks**
|
|
285
|
+
|
|
286
|
+
File: `examples/everyday_mc5.py`
|
|
287
|
+
- ✅ Check daily tasks and rewards
|
|
288
|
+
- ✅ Search players by dogtag
|
|
289
|
+
- ✅ Manage clan members
|
|
290
|
+
- ✅ Send messages to friends
|
|
291
|
+
- ✅ Check profile stats
|
|
292
|
+
- ✅ Interactive and user-friendly
|
|
293
|
+
|
|
294
|
+
**Usage:**
|
|
295
|
+
```bash
|
|
296
|
+
python examples/everyday_mc5.py
|
|
292
297
|
```
|
|
293
298
|
|
|
294
|
-
**
|
|
295
|
-
```python
|
|
296
|
-
from mc5_api_client.simple_client import monitor_clan_activity
|
|
299
|
+
### **🛡️ Admin Tools**
|
|
297
300
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
File: `examples/admin_tools.py`
|
|
302
|
+
- ✅ Update player scores (add rating)
|
|
303
|
+
- ✅ Manage squad members
|
|
304
|
+
- ✅ Kick members with confirmation
|
|
305
|
+
- ✅ Handle clan requests
|
|
306
|
+
- ✅ Safe admin operations
|
|
307
|
+
|
|
308
|
+
**Usage:**
|
|
309
|
+
```bash
|
|
310
|
+
python examples/admin_tools.py
|
|
304
311
|
```
|
|
305
312
|
|
|
306
|
-
**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
# Update clan settings
|
|
319
|
-
client.update_clan_settings(name="Elite Squad 2026")
|
|
313
|
+
### **⚡ Quick Reference**
|
|
314
|
+
|
|
315
|
+
File: `examples/quick_reference.py`
|
|
316
|
+
- ✅ Copy-paste ready examples
|
|
317
|
+
- ✅ All common operations
|
|
318
|
+
- ✅ Error handling patterns
|
|
319
|
+
- ✅ Batch operations
|
|
320
|
+
- ✅ One-liner functions
|
|
321
|
+
|
|
322
|
+
**Usage:**
|
|
323
|
+
```bash
|
|
324
|
+
python examples/quick_reference.py
|
|
320
325
|
```
|
|
321
326
|
|
|
322
|
-
**
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
### **📧 Message Management**
|
|
328
|
+
|
|
329
|
+
File: `examples/message_management.py`
|
|
330
|
+
- ✅ Get inbox messages
|
|
331
|
+
- ✅ Delete single/multiple messages
|
|
332
|
+
- ✅ Clear entire inbox
|
|
333
|
+
- ✅ Send private messages
|
|
334
|
+
- ✅ Squad wall communication
|
|
335
|
+
|
|
336
|
+
**Usage:**
|
|
337
|
+
```bash
|
|
338
|
+
python examples/message_management.py
|
|
329
339
|
```
|
|
330
340
|
|
|
331
|
-
###
|
|
341
|
+
### **🏰 Clan Management**
|
|
332
342
|
|
|
333
|
-
|
|
334
|
-
- ✅
|
|
335
|
-
- ✅
|
|
336
|
-
- ✅
|
|
337
|
-
- ✅
|
|
338
|
-
- ✅
|
|
343
|
+
File: `examples/clan_management.py`
|
|
344
|
+
- ✅ Create and manage clans
|
|
345
|
+
- ✅ Invite and kick members
|
|
346
|
+
- ✅ Update clan settings
|
|
347
|
+
- ✅ Handle applications
|
|
348
|
+
- ✅ Clan statistics
|
|
339
349
|
|
|
340
|
-
|
|
350
|
+
**Usage:**
|
|
351
|
+
```bash
|
|
352
|
+
python examples/clan_management.py
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### **📅 Events & Tasks**
|
|
356
|
+
|
|
357
|
+
File: `examples/events_and_tasks.py`
|
|
358
|
+
- ✅ Check daily tasks
|
|
359
|
+
- ✅ Monitor events
|
|
360
|
+
- ✅ Track progress
|
|
361
|
+
- ✅ Get rewards
|
|
362
|
+
- ✅ Event automation
|
|
363
|
+
|
|
364
|
+
**Usage:**
|
|
365
|
+
```bash
|
|
366
|
+
python examples/events_and_tasks.py
|
|
367
|
+
```
|
|
341
368
|
|
|
342
|
-
|
|
343
|
-
|------|----------------|------------------|
|
|
344
|
-
| Search Player | `client.search_player('f55f')` | `client.get_player_stats_by_dogtag('f55f')` |
|
|
345
|
-
| Get Clan Members | `client.get_clan_members()` | `client.get_clan_members(clan_id)` |
|
|
346
|
-
| Kick Member | `client.kick_member('9gg9')` | `client.kick_clan_member_by_dogtag('9gg9', clan_id)` |
|
|
347
|
-
| Connect | `client.connect()` | Manual authentication |
|
|
369
|
+
### **🔐 Encrypted Tokens**
|
|
348
370
|
|
|
349
|
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
371
|
+
File: `examples/help_system.py` (includes token examples)
|
|
372
|
+
- ✅ Generate encrypted tokens
|
|
373
|
+
- ✅ Encrypt existing tokens
|
|
374
|
+
- ✅ Security best practices
|
|
375
|
+
- ✅ Custom nonce support
|
|
354
376
|
|
|
355
|
-
|
|
377
|
+
**Usage:**
|
|
378
|
+
```bash
|
|
379
|
+
python examples/help_system.py
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**🎯 Why These Examples?**
|
|
383
|
+
- ✅ **No Setup Required**: Just add your credentials
|
|
384
|
+
- ✅ **Interactive**: User-friendly prompts
|
|
385
|
+
- ✅ **Safe Operations**: Confirmations for destructive actions
|
|
386
|
+
- ✅ **Error Handling**: Clear error messages
|
|
387
|
+
- ✅ **Real-World Tested**: Based on actual MC5 API usage
|
|
388
|
+
- ✅ **Copy-Paste Ready**: Easy to customize
|
|
389
|
+
|
|
390
|
+
**🚀 Getting Started:**
|
|
391
|
+
1. Install: `pip install mc5_api_client==1.0.14`
|
|
392
|
+
2. Copy example file
|
|
393
|
+
3. Add your MC5 credentials
|
|
394
|
+
4. Run the script
|
|
395
|
+
5. Done!
|
|
396
|
+
|
|
397
|
+
## � **Built-in Help System**
|
|
356
398
|
|
|
357
399
|
New in v1.0.8! Comprehensive help commands built right into the library:
|
|
358
400
|
|
|
@@ -398,7 +440,9 @@ client.connect()
|
|
|
398
440
|
player = client.search_player('f55f')
|
|
399
441
|
|
|
400
442
|
# 🔹 Admin Operations
|
|
401
|
-
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
443
|
+
result = quick_update_player_score('user_id', 5200, xp=2037745)
|
|
444
|
+
if result.get('success'):
|
|
445
|
+
print(f"Score updated: {result.get('score_updated')}")
|
|
402
446
|
|
|
403
447
|
# 🔹 Error Handling
|
|
404
448
|
try: except AuthenticationError:
|
|
@@ -410,10 +454,10 @@ try: except MC5APIError:
|
|
|
410
454
|
### **🚀 Install from PyPI (Recommended)**
|
|
411
455
|
|
|
412
456
|
```bash
|
|
413
|
-
pip install mc5_api_client==1.0.
|
|
457
|
+
pip install mc5_api_client==1.0.14
|
|
414
458
|
```
|
|
415
459
|
|
|
416
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
460
|
+
✅ **Published and Available!** The MC5 API Client v1.0.14 is now live on PyPI with ready-to-use examples and simplified documentation!
|
|
417
461
|
|
|
418
462
|
### **� Install from Local Package**
|
|
419
463
|
|
|
@@ -110,9 +110,12 @@ result = quick_update_player_score(
|
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
if result.get('success'):
|
|
113
|
-
print("✅ Player score updated successfully!")
|
|
114
|
-
print(f"New score: {result.get('
|
|
115
|
-
|
|
113
|
+
print(f"✅ Player score updated successfully!")
|
|
114
|
+
print(f"New score: {result.get('score_updated')}")
|
|
115
|
+
if result.get('xp_updated'):
|
|
116
|
+
print(f"New XP: {result.get('xp_updated')}")
|
|
117
|
+
else:
|
|
118
|
+
print(f"❌ Error: {result.get('error', 'Unknown error')}")
|
|
116
119
|
```
|
|
117
120
|
|
|
118
121
|
### **� Admin Client Usage:**
|
|
@@ -151,130 +154,169 @@ client.close()
|
|
|
151
154
|
### **🔧 How It Actually Works:**
|
|
152
155
|
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
153
156
|
|
|
154
|
-
##
|
|
155
|
-
|
|
156
|
-
New in v1.0.7! We've added a revolutionary super-simple interface for non-developers:
|
|
157
|
+
## � **Quick Start - What Most Users Want**
|
|
157
158
|
|
|
158
|
-
### **🚀
|
|
159
|
+
### **🚀 Everyday MC5 Tasks (3 Lines)**
|
|
159
160
|
|
|
160
161
|
```python
|
|
161
162
|
from mc5_api_client import SimpleMC5Client
|
|
162
163
|
|
|
163
|
-
# Connect and
|
|
164
|
+
# Connect and check your daily tasks
|
|
164
165
|
client = SimpleMC5Client('YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
165
166
|
client.connect()
|
|
166
167
|
|
|
167
|
-
#
|
|
168
|
-
|
|
169
|
-
print(f"
|
|
168
|
+
# Check your profile
|
|
169
|
+
profile = client.client.get_profile()
|
|
170
|
+
print(f"Level: {profile['level']}, Score: {profile['score']:,}")
|
|
170
171
|
```
|
|
171
172
|
|
|
172
|
-
###
|
|
173
|
+
### **� Search Players Instantly**
|
|
173
174
|
|
|
174
|
-
**Search Players:**
|
|
175
175
|
```python
|
|
176
|
-
# One-line search
|
|
176
|
+
# One-line player search
|
|
177
177
|
from mc5_api_client import quick_search
|
|
178
|
-
player = quick_search('
|
|
178
|
+
player = quick_search('f55f', 'YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
179
179
|
print(f"Elite player: {player['kills']:,} kills!")
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
### **🛡️ Admin Score Updates (Working Example)**
|
|
183
|
+
|
|
183
184
|
```python
|
|
184
|
-
from mc5_api_client
|
|
185
|
+
from mc5_api_client import quick_update_player_score
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
# Add 5200 rating to squad by updating player score
|
|
188
|
+
result = quick_update_player_score(
|
|
189
|
+
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
190
|
+
score=5200,
|
|
191
|
+
xp=2037745,
|
|
192
|
+
killsig_color="-974646126",
|
|
193
|
+
killsig_id="default_killsig_80"
|
|
194
|
+
)
|
|
188
195
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
else:
|
|
194
|
-
print(f"👤 Player: {player['dogtag']} - {player['kills']:,} kills")
|
|
196
|
+
if result.get('success'):
|
|
197
|
+
print(f"✅ Score updated: {result.get('score_updated')}")
|
|
198
|
+
else:
|
|
199
|
+
print(f"❌ Error: {result.get('error', 'Unknown error')}")
|
|
195
200
|
```
|
|
196
201
|
|
|
197
|
-
**
|
|
198
|
-
```python
|
|
199
|
-
from mc5_api_client.simple_client import clan_cleanup
|
|
200
|
-
|
|
201
|
-
# Intelligent cleanup with conditional logic
|
|
202
|
-
results = clan_cleanup(
|
|
203
|
-
'YOUR_USERNAME', 'YOUR_PASSWORD',
|
|
204
|
-
inactive_days=30,
|
|
205
|
-
min_level=15, # Protect high-level players
|
|
206
|
-
dry_run=True # Simulation only
|
|
207
|
-
)
|
|
202
|
+
## � **Examples Folder - Ready-to-Use Scripts**
|
|
208
203
|
|
|
209
|
-
|
|
210
|
-
print(f"Protected: {results['protected']} members")
|
|
204
|
+
New in v1.0.14! We've created practical, ready-to-use scripts for common MC5 tasks:
|
|
211
205
|
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
### **🎮 Everyday MC5 Tasks**
|
|
207
|
+
|
|
208
|
+
File: `examples/everyday_mc5.py`
|
|
209
|
+
- ✅ Check daily tasks and rewards
|
|
210
|
+
- ✅ Search players by dogtag
|
|
211
|
+
- ✅ Manage clan members
|
|
212
|
+
- ✅ Send messages to friends
|
|
213
|
+
- ✅ Check profile stats
|
|
214
|
+
- ✅ Interactive and user-friendly
|
|
215
|
+
|
|
216
|
+
**Usage:**
|
|
217
|
+
```bash
|
|
218
|
+
python examples/everyday_mc5.py
|
|
214
219
|
```
|
|
215
220
|
|
|
216
|
-
**
|
|
217
|
-
```python
|
|
218
|
-
from mc5_api_client.simple_client import monitor_clan_activity
|
|
221
|
+
### **🛡️ Admin Tools**
|
|
219
222
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
File: `examples/admin_tools.py`
|
|
224
|
+
- ✅ Update player scores (add rating)
|
|
225
|
+
- ✅ Manage squad members
|
|
226
|
+
- ✅ Kick members with confirmation
|
|
227
|
+
- ✅ Handle clan requests
|
|
228
|
+
- ✅ Safe admin operations
|
|
229
|
+
|
|
230
|
+
**Usage:**
|
|
231
|
+
```bash
|
|
232
|
+
python examples/admin_tools.py
|
|
226
233
|
```
|
|
227
234
|
|
|
228
|
-
**
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
# Update clan settings
|
|
241
|
-
client.update_clan_settings(name="Elite Squad 2026")
|
|
235
|
+
### **⚡ Quick Reference**
|
|
236
|
+
|
|
237
|
+
File: `examples/quick_reference.py`
|
|
238
|
+
- ✅ Copy-paste ready examples
|
|
239
|
+
- ✅ All common operations
|
|
240
|
+
- ✅ Error handling patterns
|
|
241
|
+
- ✅ Batch operations
|
|
242
|
+
- ✅ One-liner functions
|
|
243
|
+
|
|
244
|
+
**Usage:**
|
|
245
|
+
```bash
|
|
246
|
+
python examples/quick_reference.py
|
|
242
247
|
```
|
|
243
248
|
|
|
244
|
-
**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
### **📧 Message Management**
|
|
250
|
+
|
|
251
|
+
File: `examples/message_management.py`
|
|
252
|
+
- ✅ Get inbox messages
|
|
253
|
+
- ✅ Delete single/multiple messages
|
|
254
|
+
- ✅ Clear entire inbox
|
|
255
|
+
- ✅ Send private messages
|
|
256
|
+
- ✅ Squad wall communication
|
|
257
|
+
|
|
258
|
+
**Usage:**
|
|
259
|
+
```bash
|
|
260
|
+
python examples/message_management.py
|
|
251
261
|
```
|
|
252
262
|
|
|
253
|
-
###
|
|
263
|
+
### **🏰 Clan Management**
|
|
254
264
|
|
|
255
|
-
|
|
256
|
-
- ✅
|
|
257
|
-
- ✅
|
|
258
|
-
- ✅
|
|
259
|
-
- ✅
|
|
260
|
-
- ✅
|
|
265
|
+
File: `examples/clan_management.py`
|
|
266
|
+
- ✅ Create and manage clans
|
|
267
|
+
- ✅ Invite and kick members
|
|
268
|
+
- ✅ Update clan settings
|
|
269
|
+
- ✅ Handle applications
|
|
270
|
+
- ✅ Clan statistics
|
|
261
271
|
|
|
262
|
-
|
|
272
|
+
**Usage:**
|
|
273
|
+
```bash
|
|
274
|
+
python examples/clan_management.py
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### **📅 Events & Tasks**
|
|
278
|
+
|
|
279
|
+
File: `examples/events_and_tasks.py`
|
|
280
|
+
- ✅ Check daily tasks
|
|
281
|
+
- ✅ Monitor events
|
|
282
|
+
- ✅ Track progress
|
|
283
|
+
- ✅ Get rewards
|
|
284
|
+
- ✅ Event automation
|
|
285
|
+
|
|
286
|
+
**Usage:**
|
|
287
|
+
```bash
|
|
288
|
+
python examples/events_and_tasks.py
|
|
289
|
+
```
|
|
263
290
|
|
|
264
|
-
|
|
265
|
-
|------|----------------|------------------|
|
|
266
|
-
| Search Player | `client.search_player('f55f')` | `client.get_player_stats_by_dogtag('f55f')` |
|
|
267
|
-
| Get Clan Members | `client.get_clan_members()` | `client.get_clan_members(clan_id)` |
|
|
268
|
-
| Kick Member | `client.kick_member('9gg9')` | `client.kick_clan_member_by_dogtag('9gg9', clan_id)` |
|
|
269
|
-
| Connect | `client.connect()` | Manual authentication |
|
|
291
|
+
### **🔐 Encrypted Tokens**
|
|
270
292
|
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
293
|
+
File: `examples/help_system.py` (includes token examples)
|
|
294
|
+
- ✅ Generate encrypted tokens
|
|
295
|
+
- ✅ Encrypt existing tokens
|
|
296
|
+
- ✅ Security best practices
|
|
297
|
+
- ✅ Custom nonce support
|
|
276
298
|
|
|
277
|
-
|
|
299
|
+
**Usage:**
|
|
300
|
+
```bash
|
|
301
|
+
python examples/help_system.py
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**🎯 Why These Examples?**
|
|
305
|
+
- ✅ **No Setup Required**: Just add your credentials
|
|
306
|
+
- ✅ **Interactive**: User-friendly prompts
|
|
307
|
+
- ✅ **Safe Operations**: Confirmations for destructive actions
|
|
308
|
+
- ✅ **Error Handling**: Clear error messages
|
|
309
|
+
- ✅ **Real-World Tested**: Based on actual MC5 API usage
|
|
310
|
+
- ✅ **Copy-Paste Ready**: Easy to customize
|
|
311
|
+
|
|
312
|
+
**🚀 Getting Started:**
|
|
313
|
+
1. Install: `pip install mc5_api_client==1.0.14`
|
|
314
|
+
2. Copy example file
|
|
315
|
+
3. Add your MC5 credentials
|
|
316
|
+
4. Run the script
|
|
317
|
+
5. Done!
|
|
318
|
+
|
|
319
|
+
## � **Built-in Help System**
|
|
278
320
|
|
|
279
321
|
New in v1.0.8! Comprehensive help commands built right into the library:
|
|
280
322
|
|
|
@@ -320,7 +362,9 @@ client.connect()
|
|
|
320
362
|
player = client.search_player('f55f')
|
|
321
363
|
|
|
322
364
|
# 🔹 Admin Operations
|
|
323
|
-
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
365
|
+
result = quick_update_player_score('user_id', 5200, xp=2037745)
|
|
366
|
+
if result.get('success'):
|
|
367
|
+
print(f"Score updated: {result.get('score_updated')}")
|
|
324
368
|
|
|
325
369
|
# 🔹 Error Handling
|
|
326
370
|
try: except AuthenticationError:
|
|
@@ -332,10 +376,10 @@ try: except MC5APIError:
|
|
|
332
376
|
### **🚀 Install from PyPI (Recommended)**
|
|
333
377
|
|
|
334
378
|
```bash
|
|
335
|
-
pip install mc5_api_client==1.0.
|
|
379
|
+
pip install mc5_api_client==1.0.14
|
|
336
380
|
```
|
|
337
381
|
|
|
338
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
382
|
+
✅ **Published and Available!** The MC5 API Client v1.0.14 is now live on PyPI with ready-to-use examples and simplified documentation!
|
|
339
383
|
|
|
340
384
|
### **� Install from Local Package**
|
|
341
385
|
|