Skip to main content

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 lookup
  • key = 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


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.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

malody-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file malody-0.1.0.tar.gz.

File metadata

  • Download URL: malody-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for malody-0.1.0.tar.gz
Algorithm Hash digest
SHA256 68aecc78de064fe0c477f01d311d973ebdb4e705444cb2541f3cafe05a567b56
MD5 7ea674cc0f504a60e497347629ae2836
BLAKE2b-256 e780d430057fbb892790cd23fb28b0fc9fd9626e98f0d4a52e2221e1ae927b8a

See more details on using hashes here.

File details

Details for the file malody-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: malody-0.1.0-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

Hashes for malody-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44e453355de0f8c38b7788e9e3839acf44ce5c12f353f5f72f81657340ee69a4
MD5 bf40bcd05ddb362ce2a291ea444be311
BLAKE2b-256 99e371d35460f518158923444a6828b9accfe7e2a058a7ad47c3b126a529456c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page