Unofficial Python wrapper for Malody game API
Project description
README.md
malody
Python wrapper for Malody game API
pip install malody
Quick Start
import malody
key = "your_api_key_here"
uid = 1000 # Player ID
info = malody.player.info(uid, key)
print(info["username"]) # "chonicle"
All Functions
info(touid, key)
malody.player.info(1000, "your_key")
Returns:
{
"username": "chonicle",
"uid": 2,
"avatar": "2.png",
"gender": 2,
"playTime": 88,
"gold": 21494,
"regtime": 1406271800,
"area": 9,
"active": 2,
"banner": "/banner/2.jpg!banner"
}
activity(touid, key)
malody.player.activity(1000, "your_key")
Returns:
{
"code": 0,
"data": [
{
"time": 1533644730,
"msg": "chonicle's chart has been unstabled by xipigu",
"link": "/chart/11359"
},
{
"time": 1495596563,
"msg": "chonicle has unlocked First ring",
"link": "/accounts/user/achieve/2"
}
],
"hasMore": false,
"next": 1458861740
}
chart(touid, key)
malody.player.chart(1000, "your_key")
Returns:
{
"code": 0,
"data": [
{
"sid": 611,
"cid": 1480,
"title": "Hana wa Odore ya Irohaniho",
"artist": "Team \"Hanayamata\"",
"version": "7K easy voice",
"level": 0,
"length": 84,
"mode": 0
},
{
"sid": 511,
"cid": 1206,
"title": "Soutaisei VISION",
"artist": "nao",
"version": "Extreme Lv.22",
"level": 22,
"length": 99,
"mode": 4
}
],
"hasMore": false,
"next": 1436969618
}
rank(touid, key)
malody.player.rank(1000, "your_key")
Returns:
{
"code": 0,
"data": [
{
"mode": 0,
"rank": 329338,
"level": 6,
"pc": 19,
"acc": 95.7246376811594,
"combo": 728
},
{
"mode": 4,
"rank": 2976,
"level": 6,
"pc": 14,
"acc": 96.5382484115106,
"combo": 554
}
],
"hasMore": false,
"next": 0
}
wiki(touid, key, lang=0, raw=1)
malody.player.wiki(1000, "your_key", lang=1)
Returns:
{
"code": 0,
"wiki": "=Samplitude教程=\n\n[http://m.mugzone.net/page/444 tutorial]",
"raw": true
}
Full Example
import malody
key = "L-IOzHDc4Ug8OWJsAwD89Y..."
uid = 1000
# Get all data
info = malody.player.info(uid, key)
activity = malody.player.activity(uid, key)
charts = malody.player.chart(uid, key)
rank = malody.player.rank(uid, key)
wiki = malody.player.wiki(uid, key)
print(f"Player: {info['username']}")
print(f"Created {len(charts['data'])} charts")
print(f"Key mode rank: {rank['data'][0]['rank']}")
print(f"Recent activity: {activity['data'][0]['msg']}")
Notes
touid= player ID to lookupkey= your API key- Returns dict on success
- Returns None on error
todo
- add functions for skins/maps
- add skin/map downloader?
- write up on how to get api key
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
malody-0.1.1.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file malody-0.1.1.tar.gz.
File metadata
- Download URL: malody-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5383ef006cc36ae84b4a92e79eaa52d2fe8bc8de8d577af02b2e09f684ad413
|
|
| MD5 |
1e584fed83a8f057b619cfb0803f67f3
|
|
| BLAKE2b-256 |
05d866e329278c355681214d75961943f5e0cc9ceadaf5a6cd06b4a4409c460d
|
File details
Details for the file malody-0.1.1-py3-none-any.whl.
File metadata
- Download URL: malody-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d306685beae013574a6ff916f3b03e6c2d5ab88634e5125e71844953a2c408cf
|
|
| MD5 |
06f02161a78e99057a63a5824c6f75eb
|
|
| BLAKE2b-256 |
ba689eec7e723304716173a083db473607c3a346566e7e27ebd68c402a24c574
|