use - Hell13Cat/PyOSU GitHub Wiki
Import:
import pyosu
Create a main object with a module
osu = pyosu.main("YOU_TOKEN")
Modes:
- 0 = osu!
- 1 = Taiko
- 2 = CtB
- 3 = osu!mania
user
user = get_user in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.user("Hell13Cat", 2, "pp_rank")
Hell13Cat - username
2 - mode(in integer)
pp_rank - Get only one data type (optional)
user_best
user_best = get_user_best in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.user_best("Hell13Cat", 2, "score")
Hell13Cat - username
2 - mode(in integer)
score - Get only one data type (optional)
user_recent
user_recent = get_user_recent in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.user_recent("Hell13Cat", 2, "countmiss")
Hell13Cat - username
2 - mode(in integer)
countmiss - Get only one data type (optional)
scores
scores = get_scores in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.scores("Hell13Cat", "233423", "2", "date")
Hell13Cat - username
233423 - id map
2 - mode(in integer)
date - Get only one data type (optional)
match
match = get_match in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.match("9865")
9865 - id match
beatmaps
beatmaps = get_beatmaps in API
Example:
osu = pyosu.main("YOU_TOKEN")
osu.beatmaps("58586448", limit="565", mode="2", user="scs")
58586448 - id beatmap
565 - limit of results (optional)
2 - mode beatmap (optional)
scs - Creator username (optional)
construct
construct - сreate your request
Example:
osu = pyosu.main("YOU_TOKEN")
osu.construct("get_user", {"u":"Hell13Cat","m":"2"})
This example is equivalent to a query: https://osu.ppy.sh/api/get_user?k=YOU_TOKEN&u=Hell13Cat&m=2