API Reference¶
This page covers everything osu.py is capable of.
Interactive Classes¶
- class osu.Client(auth: BaseAuthHandler | None = None, request_wait_time: float = 1.0, limit_per_minute: int = 60)¶
Main object for interacting with osu!api, which uses synchronous requests. If you’re looking for asynchronous requests, use
AsynchronousClient.IMPORTANT NOTE: This class is not thread-safe. If you wish to use with threading, use a threading lock when making requests.
Init Parameters
- auth:
BaseAuthHandler The AuthHandler object passed in when initiating the Client object
- request_wait_time:
float Default is 1.
This defines the amount of time that the client should wait before making another request. It can make it easier to stay within the rate limits without using all your requests up quickly and then waiting forever to make another. It’s most applicable in bot-type apps.
- limit_per_minute:
int Default is 60 because that’s the limit peppy requests that we stay under.
This sets a cap on the number of requests the client is allowed to make within 1 minute of time.
Make sure if you are changing the ratelimit handling that you are still following peppy’s TOU for using the API:
Use the API for good. Don’t overdo it. If in doubt, ask before (ab)using :). this section may expand as necessary.
Current rate limit is set at an insanely high 1200 requests per minute, with burst capability of up to 200 beyond that. If you require more, you probably fall into the above category of abuse. If you are doing more than 60 requests a minute, you should probably give peppy a yell.
- create_new_pm(target_id: int, message: str, is_action: bool, uuid: str | None = None) CreateNewPmResult¶
This endpoint allows you to create a new PM channel.
Requires OAuth, scope chat.write, and a user (authorization code grant, delegate scope)
Parameters
- target_id:
int user_id of user to start PM with
- message:
str message to send
- is_action:
bool whether the message is an action
- uuid: Optional[
str] client-side message identifier which will be sent back in response and websocket json.
Returns
- target_id:
- create_topic(body: str, forum_id: int, title: str, with_poll: bool | None = None, hide_results: bool | None = None, length_days: int | None = None, max_options: int | None = None, poll_options: str | None = None, poll_title: str | None = None, vote_change: bool | None = None) CreateTopicResult¶
Create a new topic.
Requires OAuth, scope forum.write, and a user (authorization code grant, delegate scope)
Parameters
- body:
str Content of the topic.
- forum_id:
int Forum to create the topic in.
- title:
str Title of the topic.
- with_poll: Optional[
bool] Enable this to also create poll in the topic (default: false).
- hide_results: Optional[
bool] Enable this to hide result until voting period ends (default: false).
- length_days: Optional[
int] Number of days for voting period. 0 means the voting will never ends (default: 0). This parameter is required if hide_results option is enabled.
- max_options: Optional[
int] Maximum number of votes each user can cast (default: 1).
- poll_options: Optional[
str] Newline-separated list of voting options. BBCode is supported.
- poll_title: Optional[
str] Title of the poll.
- vote_change: Optional[
bool] Enable this to allow user to change their votes (default: false).
Returns
- body:
- edit_post(post: int, body: str) ForumPost¶
Edit specified forum post.
Requires OAuth and scope forum.write
- post:
int Id of the post.
- body:
str New post content in BBCode format.
Returns
- post:
- edit_topic(topic: int, topic_title: str) ForumTopic¶
Edit topic. Only title can be edited through this endpoint.
Requires OAuth and scope forum.write
Parameters
- topic:
int Id of the topic.
- topic_title:
str New topic title.
Returns
- topic:
- classmethod from_client_credentials(*args, **kwargs)¶
DEPRECATED AS OF v2.2.0
Use from_credentials
- classmethod from_credentials(client_id: int, client_secret: str, redirect_url: str | None, scope: ~osu.objects.scope.Scope | None = <osu.objects.scope.Scope object>, code: str | None = None, request_wait_time: float = 1.0, limit_per_minute: int = 60, lazily_authenticate: bool = True) Client¶
Returns a
Clientobject from client id, client secret, redirect uri, and scope.Parameters
- client_id:
int API Client id
- client_secret:
int API Client secret
- redirect_uri: Optional[
str] API redirect uri
- scope: Optional[
Scope] Scopes to use. Default is Scope.default() which is just the public scope.
- code: Optional[
str] If provided, is used to authorize. Read more about this under
AuthHandler.get_auth_token- request_wait_time:
float Default is 1.
This defines the amount of time that the client should wait before making another request. It can make it easier to stay within the rate limits without using all your requests up quickly and then waiting forever to make another. It’s most applicable in bot-type apps.
- limit_per_minute:
int Default is 60 because that’s the limit peppy requests that we stay under.
This sets a cap on the number of requests the client is allowed to make within 1 minute of time.
- lazily_authenticate:
bool If true, the
AuthHandlerwon’t authenticate with the api until a request is made which requires it.
Returns
- client_id:
- get_beatmap(beatmap: int) Beatmap¶
Gets beatmap data for the specified beatmap ID.
Requires OAuth and scope public
Parameters
- beatmap:
int The ID of the beatmap
Returns
BeatmapIncludes attributes beatmapset, beatmapset.ratings, failtimes, max_combo.
- beatmap:
- get_beatmap_attributes(beatmap: int, mods: int | Mods | Sequence[str | Mods | int] | None = None, ruleset: str | GameModeStr | None = None, ruleset_id: int | GameModeInt | None = None) BeatmapDifficultyAttributes¶
Returns difficulty attributes of beatmap with specific mode and mods combination.
Requires OAuth and scope public
Parameters
- beatmap:
int Beatmap id.
- mods: Optional[Union[
int, Sequence[Union[str,Mods,int]],Mods]] Mod combination. Can be either a bitset of mods, a Mods enum, or array of any. Defaults to no mods. Some mods may cause the api to throw an HTTP 422 error depending on the map’s gamemode.
- ruleset: Optional[Union[
GameModeStr,str]] Ruleset of the difficulty attributes. Only valid if it’s the beatmap ruleset or the beatmap can be converted to the specified ruleset. Defaults to ruleset of the specified beatmap.
- ruleset_id: Optional[Union[
GameModeInt,int]] The same as ruleset but in integer form.
Returns
- beatmap:
- get_beatmap_scores(beatmap: int, mode: str | GameModeStr | None = None, mods: Mods | Sequence[Mods | Mod | str] | None = None, ranking_type: str | None = None) BeatmapScores¶
Returns the top scores for a beatmap
Requires OAuth and scope public
Parameters
- beatmap:
int Id of the beatmap
- mode: Optional[Union[
str,GameModeStr]] The game mode to get scores for
- mods: Optional[Union[
Mods, Sequence[Union[Mods,Mod,str]]]] Must pass one of: a
Modsobject, a list of string mod abbreviations, a list ofModsobjects, a list of :classL`Mod` objects- ranking_type: Optional[
str] Beatmap score ranking type. Currently doesn’t do anything.
Returns
BeatmapScoresLegacyScoreobject inside includes “user” and the included user includes “country” and “cover”.
- beatmap:
- get_beatmaps(ids: Sequence[int] | None = None) List[Beatmap]¶
Returns list of beatmaps.
Requires OAuth and scope public
Parameters
- ids: Optional[List[
int]] Beatmap id to be returned. Specify once for each beatmap id requested. Up to 50 beatmaps can be requested at once.
Returns
- List[
Beatmap] Includes attributes beatmapset, beatmapset.ratings, failtimes, max_combo.
- ids: Optional[List[
- get_beatmapset(beatmapset_id: int) Beatmapset¶
Get beatmapset by id.
Requires OAuth and scope public
Parameters
beatmapset_id:
intReturns
- get_beatmapset_discussion_posts(beatmapset_discussion_id: int | None = None, limit: int | None = None, page: int | None = None, sort: str | None = None, types: Sequence[str] | None = None, user: int | None = None, with_deleted: str | None = None, cursor: Dict[str, int] | None = None) BeatmapsetDiscussionPostsResult¶
Returns the posts of the beatmapset discussions
Requires OAuth and scope public
Parameters
- beatmapset_discussion_id: Optional[
int] id of the BeatmapsetDiscussion
- limit: Optional[
int] Maximum number of results
- page: Optional[
int] Search results page.
- sort: Optional[
str] id_desc for newest first; id_asc for oldest first. Defaults to id_desc
- type: Optional[Sequence[
str]] first, reply, system are the valid values. Defaults to reply.
- user: Optional[
int] The id of the user
- with_deleted: Optional[
str] This param has no effect as api calls do not currently receive group permissions.
- cursor: Optional[Dict[
str,int]] A cursor object received from a previous call to get_beatmapset_discussion_posts (
BeatmapsetDiscussionPostsResult.cursor)
Returns
BeatmapsetDiscussionsPostsResult- beatmapset_discussion_id: Optional[
- get_beatmapset_discussion_votes(beatmapset_discussion_id: int | None = None, limit: int | None = None, page: int | None = None, receiver: int | None = None, score: int | None = None, sort: str | None = None, user: int | None = None, with_deleted: str | None = None, cursor: Dict[str, int] | None = None) BeatmapsetDiscussionVotesResult¶
Returns the votes given to beatmapset discussions
Requires OAuth and scope public
Parameters
- beatmapset_discussion_id: Optional[
int] id of the BeatmapsetDiscussion
- limit: Optional[
int] Maximum number of results
- page: Optional[
int] Search results page.
- receiver: Optional[
int] The id of the User receiving the votes.
- score: Optional[
int] 1 for upvote, -1 for downvote
- sort: Optional[
str] id_desc for newest first; id_asc for oldest first. Defaults to id_desc
- user: Optional[
int] The id of the User giving the votes.
- with_deleted: Optional[
str] This param has no effect as api calls do not currently receive group permissions
- cursor: Optional[Dict[
str,int]] A cursor object received from a previous call to get_beatmapset_discussion_votes (
BeatmapsetDiscussionVotesResult.cursor)
Returns
- beatmapset_discussion_id: Optional[
- get_beatmapset_discussions(beatmap_id: int | None = None, beatmapset_id: int | None = None, beatmapset_status: str | None = None, limit: int | None = None, message_types: Sequence[str | MessageType] | None = None, only_unresolved: bool | None = None, page: int | None = None, sort: str | None = None, user: int | None = None, with_deleted: str | None = None, cursor: Dict[str, int] | None = None) BeatmapsetDiscussionsResult¶
Returns a list of beatmapset discussions
Requires OAuth and scope public
Parameters
- beatmap_id: Optional[
int] id of the beatmap
- beatmapset_id: Optional[
int] id of the beatmapset
- beatmapset_status: Optional[
str] One of all, ranked, qualified, disqualified, never_qualified. Defaults to all.
- limit: Optional[
int] Maximum number of results.
- message_types: Optional[Sequence[Union[
str,MessageType]]] None defaults to all types.
- only_unresolved: Optional[
bool] true to show only unresolved issues; false, otherwise. Defaults to false.
- page: Optional[
int] Search result page.
- sort: Optional[
str] id_desc for newest first; id_asc for oldest first. Defaults to id_desc.
- user: Optional[
int] The id of the User.
- with_deleted: Optional[
str] This param has no effect as api calls do not currently receive group permissions.
- cursor: Optional[Dict[
str,int]] A cursor object received from a previous call to get_beatmapset_discussions (
BeatmapsetDiscussionsResult.cursor)
Returns
- beatmap_id: Optional[
- get_beatmapset_events(page: int | None = None, limit: int | None = None, sort: str | BeatmapsetEventSort | None = None, type: str | BeatmapsetEventType | None = None, min_date: str | datetime | None = None, max_date: str | datetime | None = None) GetBeatmapsetEventsResult¶
Returns a list of beatmapset events.
Requires OAuth and scope public.
Parameters
page: Optional[
int]limit: Optional[
int]- sort: Optional[Union[
str,BeatmapsetEventSort]] Specified a sort order.
- type: Optional[Union[
str,BeatmapsetEventType]] Specifies for only a certain type of event to be returned.
Returns
- sort: Optional[Union[
- get_changelog_build(stream: str, build: str) Build¶
Returns details of the specified build.
Parameters
- stream:
str Update stream name.
- build:
str Build version.
Returns
A
Buildwith changelog_entries, changelog_entries.github_user, and versions included.- stream:
- get_changelog_listing(start: str | None = None, max_id: int | None = None, stream: str | None = None, end: str | None = None, message_formats: Sequence[str] | None = None) ChangelogListingResult¶
Returns a listing of update streams, builds, and changelog entries.
Parameters
- start: Optional[
str] Minimum build version.
- max_id: Optional[
int] Maximum build ID.
- stream: Optional[
str] Stream name to return builds from.
- end: Optional[
str] Maximum build version.
- message_formats: Optional[Sequence[
str]] html, markdown. Default to both.
Returns
- start: Optional[
- get_comment(comment: int) CommentBundle¶
Gets a comment and its replies up to 2 levels deep.
Does not require OAuth
Parameters
- comment:
int Comment id
Returns
- comment:
- get_comments(commentable_type: ObjectType | str | None = None, commentable_id: int | None = None, cursor: dict | None = None, parent_id: int | None = None, sort: str | CommentSort | None = None) CommentBundle¶
Returns a list comments and their replies up to 2 levels deep.
Does not require OAuth
Parameter
- commentable_type: Optional[Union[
ObjectType,str] The type of resource to get comments for. Must be of the following types: beatmapset, build, news_post
- commentable_id: Optional[
int] The id of the resource to get comments for. Id correlates with commentable_type.
- cursor: Optional[
dict] Pagination option. See
CommentSortfor detail. The format follows Cursor except it’s not currently included in the response.- parent_id: Optional[
int] Limit to comments which are reply to the specified id. Specify 0 to get top level comments.
- sort: Optional[Union[
str,CommentSort]] Sort option as defined in
CommentSort. Defaults to new for guests and user-specified default when authenticated.
Returns
CommentBundlepinned_comments is only included when commentable_type and commentable_id are specified.
- commentable_type: Optional[Union[
- get_friends() List[UserCompact]¶
Returns a list of friends.
Requires OAuth, scope friends.read, and a user (authorization code grant, delegate scope).
Returns
List[
UserCompact]
- get_match(match_id: int) MatchExtended¶
Returns a match by id.
Requires OAuth and scope public.
Parameters
- match_id:
int The match id.
Returns
- match_id:
- get_matches(limit: int | None = None, sort: str | MatchSort | None = None, cursor: Dict | None = None) GetMatchesResult¶
Returns a list of matches.
Requires OAuth and scope public.
Parameters
limit: Optional[
int]sort: Optional[Union[
str,MatchSort]]- cursor: Optional[Dict]
Dictionary containing one key: match_id. Can be obtained from a previous call to this function or manually created.
Returns
- get_news_listing(limit: int | None = None, year: int | None = None, cursor: dict | None = None) GetNewsListingResult¶
Returns a list of news posts and related metadata.
Parameters
- limit: Optional[
int] Maximum number of posts (12 default, 1 minimum, 21 maximum).
- year: Optional[
int] Year to return posts from.
- cursor: Optional[
str] Cursor for pagination.
Returns
- limit: Optional[
- get_news_post(news: str, key: str | None = None) NewsPost¶
Returns details of the specified news post.
Parameters
- news: class:str
News post slug or ID.
- key: Optional[
str] Unset to query by slug, or id to query by ID.
Returns
Returns a
NewsPostwith content and navigation included.
- get_own_data(mode: str | GameModeStr = '') User¶
Similar to get_user but with authenticated user (token owner) as user id.
Requires OAuth, scope identify, and a user (authorization code grant, delegate scope)
Parameters
- mode: Optional[
str,GameModeStr] GameMode. User default mode will be used if not specified.
Returns
See return for get_user
- mode: Optional[
- get_ranking(mode: str | GameModeStr, type: str | RankingType, country: str | None = None, cursor: dict | None = None, filter: str | None = None, spotlight: int | None = None, variant: str | None = None) Rankings¶
Gets the current ranking for the specified type and game mode.
Requires OAuth and scope public
mode: Union[
str,GameModeStr]- type: Union[
str,RankingType] RankingType- country: Optional[
str] Filter ranking by country code. Only available for type of performance.
cursor: Optional[
dict]- filter: Optional[
str] Either all (default) or friends.
- spotlight: Optional[
int] The id of the spotlight if type is charts. Ranking for latest spotlight will be returned if not specified.
- variant: Optional[
str] Filter ranking to specified mode variant. For mode of mania, it’s either 4k or 7k. Only available for type of performance.
Returns
- type: Union[
- get_replay_data(mode: str | GameModeStr | None, score_id: int, use_osrparse: bool = True) osrparse.Replay | bytes¶
Returns replay data for a score. Use
Client.get_replay_data_by_id_only()for only the id, or specify None to the mode attribute.Requires OAuth, scope public, and a user (authorization code grant, delegate scope).
Requires osu.py is installed with the ‘replay’ feature if use_osrparse is true.
Parameters
mode: Optional[Union[
str,GameModeStr]]score_id:
int- use_osrparse:
bool If true, returns an
osrparse.Replayobject. Defaults to true.
Returns
Union[
osrparse.Replay,bytes]- use_osrparse:
- get_replay_data_by_id_only(score_id: int, use_osrparse: bool = True) osrparse.Replay | bytes¶
Returns replay data for a score. Use
Client.get_replay_data()for score ids that require specifying the game mode too.Requires OAuth, scope public, and a user (authorization code grant, delegate scope).
Requires osu.py is installed with the ‘replay’ feature if use_osrparse is true.
Parameters
score_id:
int- use_osrparse:
bool If true, returns an
osrparse.Replayobject. Defaults to true.
Returns
Union[
osrparse.Replay,bytes]- use_osrparse:
- get_room(room_id: int) Room¶
Returns a room by id.
Requires OAuth and scope public.
Parameters
- room_id:
int The room id.
Returns
- room_id:
- get_room_leaderboard(room_id: int) GetRoomLeaderboardResult¶
Return a room’s leaderboard. The
UserScoreAggregateobjects returned under the “leaderboard” key contain the “user” attribute. TheUserScoreAggregateobject under the “user_score” key contains the “user” and “position” attributes.Requires OAuth, scope public, and a user (authorization code grant, delegate scope).
Parameters
room_id:
intReturns
GetRoomLeaderboard
- get_rooms(mode: str | GameModeStr = '', sort: str | RoomSort | None = None, limit: int | None = None, room_type: RoomType | str | None = None, category: RoomCategory | str | None = None, filter_mode: RoomFilterMode | str | None = None) List[Room]¶
Returns a list of rooms.
Requires OAuth, scope public, and a user (authorization code grant, delegate scope).
Parameters
- mode: Optional[Union[
str,GameModeStr]] Game mode to filter rooms by.
- sort: Optional[Union[
str,RoomSort]] Sort rooms by.
- limit: Optional[
int] max number of rooms to return
- room_type: Optional[Union[
RoomType,str]] type of room to look for
- category: Optional[Union[
RoomCategory,str]] type of category of room to look for
filter_mode: Optional[Union[
RoomFilterMode,str]]- mode: Optional[Union[
- get_score_by_id(mode: str | GameModeStr, score_id) LegacyScore | SoloScore¶
Returns a score by id.
Requires OAuth and scope public.
Parameters
mode: Union[
str,GameModeStr]score_id:
intReturns
- Union[
SoloScore,LegacyScore] Should be a SoloScore, unless for some strange reason it’s not
- Union[
- get_score_by_id_only(score_id: int) LegacyScore | SoloScore¶
Returns a score by id, not requiring a mode.
Requires OAuth and scope public.
Parameters
score_id:
intReturns
- Union[
SoloScore,LegacyScore] Should be a SoloScore, unless for some strange reason it’s not
- Union[
- get_scores(room: int, playlist: int, limit: int | None = None, sort: str | MultiplayerScoresSort | None = None, cursor: str | None = None) MultiplayerScores¶
Requires OAuth, scope public, and a user (authorization code grant, delegate scope)
Parameters
- room:
int Id of the room.
- playlist:
int Id of the playlist item.
- limit: Optional[
int] Number of scores to be returned.
sort: Optional[Union[
str,MultiplayerScoresSort]]- cursor: Optional[
str] MultiplayerScores.cursor value from a previous call to get next page.
Returns
- room:
- get_seasonal_backgrounds() SeasonalBackgrounds¶
Get the season backgrounds.
Doesn’t require OAuth
Returns
SeasonalBackgrounds
- get_spotlights() Spotlights¶
Gets the list of spotlights.
Requires OAuth and scope public
Returns
- get_topic_and_posts(topic: int, cursor: str | None = None, sort: str | None = None, limit: int | None = None, start: int | None = None, end: int | None = None) GetTopicAndPostsResult¶
Get topic and its posts.
Requires OAuth and scope public
Parameters
- topic:
int Id of the topic.
- cursor: Optional[
str] Parameter for pagination.
- sort: Optional[
str] Post sorting option. Valid values are id_asc (default) and id_desc.
- limit: Optional[
int] Maximum number of posts to be returned (20 default, 50 at most).
- start: Optional[
int] First post id to be returned with sort set to id_asc. This parameter is ignored if cursor_string is specified.
- end: Optional[
int] First post id to be returned with sort set to id_desc. This parameter is ignored if cursor_string is specified.
Returns
- topic:
- get_user(user: int, mode: str | GameModeStr | None = '', key: str | None = None) User¶
This endpoint returns the detail of specified user.
NOTE: It’s highly recommended to pass key parameter to avoid getting unexpected result (mainly when looking up user with numeric username or nonexistent user id).
Requires OAuth and scope public
Parameters
- user: Union[
int,str] Id or username of the user. Id lookup is prioritised unless key parameter is specified. Previous usernames are also checked in some cases.
- mode: Optional[Union[
str,GameModeStr] User default mode will be used if not specified.
- key: Optional[
str] Type of user passed in url parameter. Can be either id or username to limit lookup by their respective type. Passing empty or invalid value will result in id lookup followed by username lookup if not found.
Returns
UserIncludes attributes account_history, active_tournament_banner, badges, beatmap_playcounts_count, favourite_beatmapset_count, follower_count, graveyard_beatmapset_count, groups, loved_beatmapset_count, mapping_follower_count, monthly_playcounts, page, pending_beatmapset_count, previous_usernames, rank_highest, rank_history, ranked_beatmapset_count, replays_watched_counts, scores_best_count, scores_first_count, scores_recent_count, statistics, statistics.country_rank, statistics.rank, statistics.variants, support_level, user_achievements.
- user: Union[
- get_user_beatmap_score(beatmap: int, user: int, mode: str | GameModeStr | None = None, mods: Sequence[str] | None = None) BeatmapUserScore¶
Returns a user’s score on a Beatmap
Requires OAuth and scope public
Parameters
- beatmap:
int Id of the beatmap
- user:
int Id of the user
- mode: Optional[Union[
str,GameModeStr]] The game mode to get scores for
- mods: Optional[Sequence[
str]] An array of matching mods, or none. Currently doesn’t do anything.
Returns
- beatmap:
- get_user_beatmap_scores(beatmap: int, user: int, mode: str | GameModeStr | None = None) List[LegacyScore | SoloScore]¶
Returns a user’s scores on a Beatmap
Requires OAuth and scope public
Parameters
- beatmap:
int Id of the beatmap
- user:
int Id of the user
- mode: Optional[Union[
str,GameModeStr]] The game mode to get scores for
Returns
List[Union[
LegacyScore,SoloScore]]- beatmap:
- get_user_beatmaps(user: int, type: str | UserBeatmapType, limit: int | None = None, offset: int | None = None) List[BeatmapPlaycount | Beatmapset]¶
Returns the beatmaps of specified user.
Requires OAuth and scope public
Parameters
- user:
int Id of the user.
- type: Union[
str,UserBeatmapType] Beatmap type. Can be one of favourite, graveyard, loved, most_played, pending, ranked.
- limit: Optional[
int] Maximum number of results.
- offset: Optional[
int] Result offset for pagination.
Returns
- List[Union[
BeatmapPlaycount,Beatmapset]] BeatmapPlaycountfor type most_played andBeatmapsetfor any other type.
- user:
- get_user_kudosu(user: int, limit: int | None = None, offset: int | None = None)¶
Returns kudosu history.
Requires OAuth and scope public
Parameters
- user:
int Id of the user.
- limit: Optional[
int] Maximum number of results.
- offset: Optional[
int] Result offset for pagination.
Returns
Sequence[
KudosuHistory]- user:
- get_user_recent_activity(user: int, limit: int | None = None, offset: int | None = None) List[AchievementEvent | BeatmapPlaycountEvent | BeatmapsetApproveEvent | BeatmapsetDeleteEvent | BeatmapsetReviveEvent | BeatmapsetUpdateEvent | BeatmapsetUploadEvent | RankEvent | RankLostEvent | UserSupportAgain | UserSupportFirst | UserSupportGift | UsernameChangeEvent]¶
Returns recent activity.
Requires OAuth and scope public
Parameters
- user:
int Id of the user.
- limit: Optional[
int] Maximum number of results.
- offset: Optional[
int] Result offset for pagination.
Returns
- user:
- get_user_scores(user: int, type: UserScoreType | str, include_fails: bool | None = False, mode: str | GameModeStr | None = None, limit: int | None = None, offset: int | None = None) List[LegacyScore | SoloScore]¶
This endpoint returns the scores of specified user.
Requires OAuth and scope public
Parameters
- user:
int Id of the user.
- type: Union[
UserScoreTypestr] Score type. Must be one of best, firsts, recent, pinned
- include_fails: Optional[
bool] Only for recent scores, include scores of failed plays. Defaults to False.
- mode: Optional[Union[
GameModeStr,str]] game mode of the scores to be returned. Defaults to the specified user’s mode.
- limit: Optional[
int] Maximum number of results.
- offset: Optional[
int] Result offset for pagination.
Returns
- Sequence[Union[
LegacyScore,SoloScore]] Includes attributes beatmap, beatmapset. Additionally includes weight if type is best.
- user:
- get_users(ids: Sequence[int]) List[UserCompact]¶
Returns list of users.
Requires OAuth and scope public
Parameters
- ids: Sequence[
int] User id to be returned. Specify once for each user id requested. Up to 50 users can be requested at once.
Returns
- Sequence[
UserCompact] Includes attributes: country, cover, groups, statistics_rulesets.
- ids: Sequence[
- get_wiki_page(locale: str, path: str) WikiPage¶
The wiki article or image data.
No OAuth required.
Parameters
- locale:
str Two-letter language code of the wiki page.
- path:
str The path name of the wiki page.
Returns
- locale:
- lookup_beatmap(checksum: str | None = None, filename: str | None = None, id: int | None = None) Beatmap¶
Returns beatmap.
Requires OAuth and scope public
Parameters
- checksum: Optional[
str] A beatmap checksum.
- filename: Optional[
str] A filename to lookup
- id: Optional[
int] A beatmap ID to lookup
Returns
- checksum: Optional[
- lookup_changelog_build(changelog: str, key: str | None = None, message_formats: Sequence[str] | None = None) Build¶
Returns details of the specified build.
Parameters
- changelog:
str Build version, update stream name, or build ID.
- key: Optional[
str] Leave blank to query by build version or stream name, or id to query by build ID.
- message_formats: Optional[Sequence[
str]] html, markdown. Default to both.
Returns
A
Buildwith changelog_entries, changelog_entries.github_user, and versions included.- changelog:
- reply_topic(topic: int, body: str) ForumPost¶
Create a post replying to the specified topic.
Requires OAuth, scope forum.write, and a user (authorization code grant, delegate scope)
Parameters
- topic:
int Id of the topic to be replied to.
- body:
str Content of the reply post.
Returns
ForumPostbody attributes included
- topic:
- revoke_current_token() None¶
Revokes currently authenticated token.
Requires OAuth
- search(mode: str | WikiSearchMode | None = None, query: str | None = None, page: int | None = None) SearchResult¶
Searches users and wiki pages.
Requires OAuth and scope public
Parameters
- mode: Optional[Union[
str,WikiSearchMode]] Either all, user, or wiki_page. Default is all.
- query: Optional[
str] Search keyword.
- page: Optional[
int] Search result page. Ignored for mode all.
Returns
- mode: Optional[Union[
- search_beatmapsets(filters: BeatmapsetSearchFilter | None = None, page: int | None = None) BeatmapsetSearchResult¶
Search for beatmapsets.
Requires OAuth and scope public.
Attributes
filters: Optional[
BeatmapsetSearchFilter]page: Optional[
int]Returns
- set_api_version(version: str) None¶
Sets x-api-version header to use when sending requests to the api. You shouldn’t have to change it from the default, but if you need to then the function is available.
Parameters
- version:
str x-api-version header value in the format yyyymmdd
- version:
- auth:
- class osu.AsynchronousClient(auth: BaseAuthHandler | None = None, request_wait_time: float = 1.0, limit_per_minute: int = 60)¶
Main object for interacting with osu!api, which uses asynchronous requests. If you’re looking for synchronous requests, use
Client.All the functions of this class are documented under
Clientand function the exact same, with the exception ofAsynchronousClient.from_credentials()Init Parameters
- auth:
AuthHandler The AuthHandler object passed in when initiating the Client object
- request_wait_time: Optional[
float] Default is 1.
This defines the amount of time that the client should wait before making another request. It can make it easier to stay within the rate limits without using all your requests up quickly and then waiting forever to make another. It’s most applicable in bot-type apps.
- limit_per_minute: Optional[
float] Default is 60 because that’s the limit peppy requests that we stay under.
This sets a cap on the number of requests the client is allowed to make within 1 minute of time.
Make sure if you are changing the ratelimit handling that you are still following peppy’s TOU for using the API:
Use the API for good. Don’t overdo it. If in doubt, ask before (ab)using :). this section may expand as necessary.
Current rate limit is set at an insanely high 1200 requests per minute, with burst capability of up to 200 beyond that. If you require more, you probably fall into the above category of abuse. If you are doing more than 60 requests a minute, you should probably give peppy a yell.
- classmethod from_credentials(client_id: int, client_secret: str, redirect_url: str | None, scope: ~osu.objects.scope.Scope | None = <osu.objects.scope.Scope object>, code: str | None = None, request_wait_time: float = 1.0, limit_per_minute: int = 60, lazily_authenticate: bool = True) AsynchronousClient | Awaitable¶
Creates client from client id, client secret, redirect uri, and scope.
Parameters
- client_id:
int API Client id
- client_secret:
int API Client secret
- redirect_uri: Optional[
str] API redirect uri
- scope: Optional[
Scope] Scopes to use. Default is Scope.default() which is just the public scope.
- code: Optional[
str] If provided, is used to authorize. Read more about this under
AuthHandler.get_auth_token- request_wait_time: Optional[
float] Default is 1.
This defines the amount of time that the client should wait before making another request. It can make it easier to stay within the rate limits without using all your requests up quickly and then waiting forever to make another. It’s most applicable in bot-type apps.
- limit_per_minute: Optional[
float] Default is 60 because that’s the limit peppy requests that we stay under.
This sets a cap on the number of requests the client is allowed to make within 1 minute of time.
- lazily_authenticate:
bool If true (default), the
AuthHandlerwon’t authenticate with the api until a request is made which requires it. If false, an Awaitable is returned.
Returns
Union[
AsynchronousClient, Awaitable]- client_id:
- auth:
- class osu.AuthHandler(client_id: int, client_secret: str, redirect_url: str, scope: ~osu.objects.scope.Scope | None = <osu.objects.scope.Scope object>)¶
- as_async() AsynchronousAuthHandler¶
Return an asynchronous version of this auth handler
- classmethod from_save_data(save_data: dict) AuthHandler¶
Create a new
FunctionalAuthHandlerobject from save data.
- get_auth_token(code: str | None = None) None¶
code parameter is not required, but without a code the scopes are restricted to public and delegate (more on delegation below). You can obtain a code by having a user authorize themselves under a url which you can get with get_auth_url. Read more about it under that function.
Client Credentials Delegation
Client Credentials Grant tokens may be allowed to act on behalf of the owner of the OAuth client (delegation) by requesting the delegate scope, in addition to other scopes supporting delegation. When using delegation, scopes that support delegation cannot be used together with scopes that do not support delegation. Delegation is only available to Chat Bots. Currently, chat.write is the only other scope that supports delegation.
Parameters
- code: Optional[
str] code from user authorizing at a specific url
- code: Optional[
- get_token() str | None¶
Returns the access token. If the token is expired, it will be refreshed before being returned.
- refresh_access_token(refresh_token: str | None = None) None¶
This function is usually executed by HTTPHandler, but if you have a refresh token saved from the last session, then you can fill in the refresh_token argument which this function will use to get a valid token.
Parameters
- refresh_token: Optional[
str] A refresh token used to get a new access token.
- refresh_token: Optional[
- class osu.AsynchronousAuthHandler(client_id: int, client_secret: str, redirect_url: str, scope: ~osu.objects.scope.Scope | None = <osu.objects.scope.Scope object>)¶
- as_sync() AuthHandler¶
Return a synchronous version of this auth handler
- async classmethod from_save_data(save_data: dict) AsynchronousAuthHandler¶
Create a new
FunctionalAuthHandlerobject from save data.
- async get_auth_token(code: str | None = None)¶
code parameter is not required, but without a code the scopes are restricted to public and delegate (more on delegation below). You can obtain a code by having a user authorize themselves under a url which you can get with get_auth_url. Read more about it under that function.
Client Credentials Delegation
Client Credentials Grant tokens may be allowed to act on behalf of the owner of the OAuth client (delegation) by requesting the delegate scope, in addition to other scopes supporting delegation. When using delegation, scopes that support delegation cannot be used together with scopes that do not support delegation. Delegation is only available to Chat Bots. Currently, chat.write is the only other scope that supports delegation.
Parameters
- code: Optional[
str] code from user authorizing at a specific url
- code: Optional[
- async get_token() str | None¶
Returns the access token. If the token is expired, it will be refreshed before being returned.
- async refresh_access_token(refresh_token: str | None = None)¶
This function is usually executed by HTTPHandler, but if you have a refresh token saved from the last session, then you can fill in the refresh_token argument which this function will use to get a valid token.
Parameters
- refresh_token: Optional[
str] A refresh token used to get a new access token.
- refresh_token: Optional[
- class osu.NotificationWebsocket(notification_uri, auth, loop=None)¶
Requires osu.py is installed with the ‘notifications’ feature
This class allows you to receive notifications without constantly polling the server. To utilize it you should do either of: - Make a class inheriting this one and redefine the event functions (on_logout, on_new, …). - Use the event function as a decorator, read more on its use under its docs.
Event types
- on_ready
Fired when the websocket establishes connection.
- on_logout
Server will disconnect session after sending this event so don’t try to reconnect.
- on_new
New notification. See
Notificationobject for notification types.Arguments
notification:
Notification- on_read
Notification has been read.
Arguments
- notifications: Sequence[
ReadNotification] list of notifications that were read
- timestamp:
datetime.datetime time at which the notifications were read
- notifications: Sequence[
- on_chat_channel_join
Broadcast to the user when the user joins a chat channel.
Arguments
- channel:
ChatChannel Has the current_user_attributes, last_message_id, and users attributes.
- channel:
- on_chat_channel_part
Broadcast to the user when the user leaves a chat channel.
Arguments
- channel:
ChatChannel Has the current_user_attributes, last_message_id, and users attributes.
- channel:
- on_chat_message_new
Sent to the user when the user receives a chat message.
Messages intented for a user are always sent even if the user does not currently have the channel open. Such messages include PM and Announcement messages.
Other messages, e.g. public channel messages are not sent if the user is no longer present in the channel.
Arguments
- messages: Sequence[
ChatMessage] The message received
- users: Sequence[
UserCompact] The related uesrs who sent the messages.
- messages: Sequence[
- on_unplanned_disconnect
Event fired by NotificationWebsocket object when there’s a disconnection without having been sent a logout event.
- connect()¶
Connect to the uri and start receiving events. This function does not return until the websocket disconnects.
- event(func)¶
Decorator for adding event functions. Example:
notification_websocket = NotificationWebsocket(notif_uri, auth) @notification_websocket.event() def new(notification): print(notification.name)
Endpoint results¶
Some endpoints return specific responses that don’t represent any specific objects.
- class osu.BeatmapsetDiscussionPostsResult(beatmapsets: List[BeatmapsetCompact], posts: List[BeatmapsetDiscussionPost], users: List[UserCompact], cursor: str)¶
Result of
osu.Client.get_beatmapset_discussion_posts()Attributes
beatmapsets: List[
BeatmapsetCompact]posts: List[
BeatmapsetDiscussionPost]users: List[
UserCompact]cursor: Dict[
str,int]
- class osu.BeatmapsetDiscussionsResult(beatmaps: List[Beatmap], discussions: List[BeatmapsetDiscussion], included_discussions: List[BeatmapsetDiscussion], users: List[UserCompact], reviews_config: ReviewsConfig, cursor: str)¶
Result of
osu.Client.get_beatmapset_discussions()Attributes
beatmaps: List[
Beatmap]discussions: List[
BeatmapsetDiscussion]included_discussions: List[
BeatmapsetDiscussion]users: List[
UserCompact]reviews_config:
ReviewsConfigcursor:
str
- class osu.BeatmapsetDiscussionVotesResult(discussions: List[BeatmapsetDiscussion], votes: List[BeatmapsetDiscussionVote], users: List[UserCompact], cursor: str)¶
Result of
osu.Client.get_beatmapset_discussion_votes()Attributes
discussions: List[
BeatmapsetDiscussion]votes: List[
BeatmapsetDiscussionVote]users: List[
UserCompact]cursor: Dict[
str,int]
- class osu.BeatmapsetSearchResult(beatmapsets: List[Beatmapset], cursor: Dict, search: SearchInfo, recommended_difficulty: float | None, error: str | None, total: int)¶
Result of
osu.Client.search_beatmapsets()Attributes
beatmapsets: List[
Beatmapset]cursor: Dict
search:
SearchInforecommended_difficulty: Optional[
int]error: Optional[
str]total:
int
- class osu.ChangelogListingResult(builds: List[Build], streams: List[UpdateStream], search: ChangelogListingSearch)¶
Result of
osu.Client.get_changelog_listing()Attributes
build: List[
Build]streams: List[
Build]search:
ChangelogListingSearch
- class osu.ChangelogListingSearch(start: str | None, end: str | None, limit: int, max_id: int | None, stream: str | None)¶
Attribute of
ChangelogListingResultAttributes
- start: Optional[
str] start input
- end: Optional[
str] end input
- limit:
int Always 21
- max_id: Optional[
int] max_id input
- stream: Optional[
str] stream input
- start: Optional[
- class osu.CreateNewPmResult(channel: ChatChannel, message: ChatMessage, new_channel_id: int)¶
Result of
osu.Client.create_new_pm()Attributes
channel:
ChatChannelmessage:
ChatMessage- new_channel_id:
int [DEPRECATED] channel id of newly created
ChatChannel
- new_channel_id:
- class osu.CreateTopicResult(topic: ForumTopic, post: ForumPost)¶
Result of
osu.Client.create_topic()Attributes
topic:
ForumTopic- post:
ForumPost includes body
- post:
- class osu.GetBeatmapsetEventsResult(events: List[BeatmapsetEvent], reviews_config: Review, users: List[UserCompact])¶
Result of
osu.Client.get_beatmapset_events()Attributes
events: List[
BeatmapsetEvent]reviews_config:
Review- users: List[
UserCompact] Includes groups attribute
- users: List[
- class osu.GetMatchesResult(matches: List[Match], params: Dict, cursor: Dict)¶
Result of
osu.Client.get_matches()Attributes
matches: List[
Match]params: Dict
cursor: Dict
- class osu.GetNewsListingResult(cursor: str, news_posts: List[NewsPost], news_sidebar: NewsSidebar, search: SearchInfo)¶
Result of
osu.Client.get_news_listing()Attributes
cursor:
strnews_posts: List[
NewsPost]news_sidebar:
NewsSidebarsearch:
SearchInfo
- class osu.GetRoomLeaderboardResult(leaderboard: List[UserScoreAggregate], user_score: UserScoreAggregate | None)¶
Result of
osu.Client.get_room_leaderboard()Attributes
leaderboard: List[
UserScoreAggregate]user_score: Optional[
UserScoreAggregate]
- class osu.GetTopicAndPostsResult(cursor_string: str, search: SearchInfo, topic: ForumTopic, posts: List[ForumPost])¶
Result of
osu.Client.get_topic_and_posts()Attributes
cursor_string:
str- search:
GetTopicAndPostsSearch Parameters used for current request excluding cursor.
topic:
ForumTopicposts: List[
ForumPost]- search:
- class osu.NewsSidebar(current_year: int, news_post: List[NewsPost], years: List[int])¶
Attribute of
GetNewsListingResultAttributes
current_year:
intnews_post: List[
NewsPost]years: List[
int]
- class osu.ReviewsConfig(max_blocks: int)¶
An attribute of
BeatmapsetDiscussionsResultAttributes
max_blocks:
int
- class osu.SearchInfo(sort: str, limit: int, start: int | None, end: int | None)¶
A class for search info in several result objects.
Attributes
sort:
strlimit:
intstart: Optional[
str]end: Optional[
str]
- class osu.SearchResult(user: List[UserCompact] | None, wiki_page: List[WikiPage] | None)¶
Result of
osu.Client.search()Attributes
- user: Optional[List[
UserCompact]] For all or user mode. Only first 100 results are accessible
- wiki_page: Optional[List[
WikiPage]] For all or wiki_page mode
- user: Optional[List[
Objects¶
- class osu.Achievement(data)¶
Attributes
icon_url:
strid:
intname:
strgrouping:
strordering:
intslug:
strdescription:
strmode: Optional[
GameModeStr]instructions: Optional[
str]
- class osu.AchievementEvent(data)¶
Attributes
achievement:
Achievementuser:
EventUser
- class osu.BaseNominations(data)¶
Base attributes for
LegacyNominationsandNominationsAttributes
disqualification: Optional[
BeatmapsetEvent]nominated: Optional[
bool]nomination_reset: Optional[
BeatmapsetEvent]ranking_eta: Optional[
str]ranking_queue_position: Optional[
int]required_hype:
int
- class osu.Beatmap(data)¶
Represent a beatmap. This extends
BeatmapCompactwith additional attributes. Also overrides the type of beatmapsetAttributes
accuracy:
floatar:
floatbeatmapset: Optional[
Beatmapset]bpm:
floatconvert: Optional[
bool]count_circles:
intcount_sliders:
intcount_spinners:
intcs:
floatdeleted_at: Optional[
datetime.datetime]drain:
floathit_length:
intis_scoreable:
boollast_updated:
datetime.datetimemode_int:
GameModeIntpasscount:
intplaycount:
intranked:
RankStatusurl:
str
- class osu.BeatmapCompact(data)¶
Represents a beatmap.
Attributes
beatmapset_id:
intdifficulty_rating:
floatid:
intmode:
GameModeStrstatus:
RankStatustotal_length:
intuser_id:
intversion:
strbeatmapset: Optional[
BeatmapsetCompact]checksum: Optional[
str]failtimes: Optional[
Failtimes]max_combo: Optional[
int]user: Optional[
UserCompact]
- class osu.BeatmapDifficultyAttributes(data)¶
Represent beatmap difficulty attributes. Following fields are always present and then there are additional fields for different rulesets.
Attributes
The parameters depend on the ruleset, but the following two attributes are present in all rulesets.
max_combo:
intstar_rating:
floatmode_attributes: Optional[Union[
OsuBeatmapDifficultyAttributes,TaikoBeatmapDifficultyAttributes,FruitsBeatmapDifficultyAttributes,ManiaBeatmapDifficultyAttributes]]Can be none for some beatmaps that are bugged and have no difficulty attributes.
type: Optional[
GameModeStr]
- class osu.BeatmapPlaycount(data)¶
Represent the playcount of a beatmap.
Attributes
beatmap_id:
intbeatmap: Optional[
BeatmapCompact]beatmapset: Optional[
BeatmapsetCompact]count:
int
- class osu.BeatmapPlaycountEvent(data)¶
Attributes
beatmap:
EventBeatmapcount:
int
- class osu.BeatmapScores(data)¶
Contains a list of scores as well as, possibly, a
BeatmapUserScoreobject.Attributes
- scores: List[Union[
LegacyScore,SoloScore]] The list of top scores for the beatmap in descending order.
- user_score: Optional[
BeatmapUserScore] The score of the current user. This is not returned if the current user does not have a score.
- scores: List[Union[
- class osu.Beatmapset(data)¶
Represents a beatmapset. This extends
BeatmapsetCompactwith additional attributes. Also overrides the type of beatmaps attribute.Attributes
availability:
BeatmapsetAvailability- beatmaps: Optional[List[
Beatmap]] null when this
Beatmapsetobject comes from aBeatmapobject
bpm:
floatcan_be_hyped:
booldeleted_at:
datetime.datetime- discussion_enabled:
bool Deprecated. Is always true.
discussion_locked:
boolis_scoreable:
boollast_updated: Optional[
datetime.datetime]legacy_thread_url:
strnominations_summary:
NominationsSummaryranked:
RankStatusranked_date: Optional[
datetime.datetime]storyboard:
boolsubmitted_date: Optional[
datetime.datetime]tags:
str- beatmaps: Optional[List[
- class osu.BeatmapsetApproveEvent(data)¶
Attributes
approval:
RankStatusbeatmapset:
EventBeatmapsetuser:
EventUser
- class osu.BeatmapsetAvailability(data)¶
Gives information on the availability of a beatmap for download.
Attributes
download_disabled:
boolmore_information: Optional[
str]
- class osu.BeatmapsetCompact(data)¶
Represents a beatmapset.
Attributes
artist:
strartist_unicode:
str- background_url:
str Not given by api but created locally based on beatmapset id.
covers:
Coverscreator:
strfavourite_count:
inthype: Optional[
BeatmapsetRequirement]id:
intnsfw:
booloffset:
intplay_count:
intpreview_url:
strsource:
strspotlight:
boolstatus:
RankStatustitle:
strtitle_unicode:
strtrack_id: Optional[
int]user_id:
intvideo:
boolavailability: Optional[
BeatmapsetAvailability]- beatmaps: Optional[List[
BeatmapCompact]] Beatmaps contained in the beatmapset
converts: Optional[List[
Beatmap]]current_nominations: Optional[List[
CurrentNomination]]current_user_attributes: Optional[
BeatmapsetDiscussionPermissions]description: Optional[
str]description_bbcode: Optional[
str]discussions: Optional[
BeatmapsetDiscussion]events: Optional[List[
BeatmapsetEvent]]genre: Optional[
MetadataAttribute]has_favourited: Optional[
bool]language: Optional[
MetadataAttribute]nominations: Optional[Union[
LegacyNominations,Nominations]]ratings: Optional[List[
int]]recent_favourites: Optional[List[
UserCompact]]related_users: Optional[List[
UserCompact]]user: Optional[
UserCompact]- background_url:
- class osu.BeatmapsetDeleteEvent(data)¶
Attributes
beatmapset:
EventBeatmapset
- class osu.BeatmapsetDiscussion(data)¶
Represents a Beatmapset modding discussion
Attributes
beatmap_id: Optional[
int]beatmapset_id:
intcan_be_resolved:
boolcan_grant_kudosu:
boolcreated_at:
datetime.datetimedeleted_at: Optional[
datetime.datetime]deleted_by_id: Optional[
int]id:
intkudosu_denied:
boollast_post_at:
datetime.datetimemessage_type:
MessageTypeparent_id: Optional[
int]resolved:
booltimestamp: Optional[
int]updated_at:
datetime.datetimeuser_id:
intbeatmap: Optional[
BeatmapCompact]beatmapset: Optional[
BeatmapsetCompact]current_user_attributes: Optional[
BeatmapsetDiscussionPermissions]posts: Optional[List[
BeatmapsetDiscussionPost]]starting_post: Optional[
BeatmapsetDiscussionPost]votes: Optional[
VotesSummary]
- class osu.BeatmapsetDiscussionPermissions(data)¶
A user’s permissions in a beatmapset discussion
Attributes
can_destroy:
boolcan_reopen:
boolcan_moderate_kudosu:
boolcan_resolve:
boolvote_score:
int
- class osu.BeatmapsetDiscussionPost(data)¶
Represents a post in a
BeatmapsetDiscussion.Attributes
beatmapset_discussion_id:
intcreated_at:
datetime.datetimedeleted_at: Optional[
datetime.datetime]deleted_by_id: Optional[
int]id:
intlast_editor_id: Optional[
int]updated_at:
datetime.datetimeuser_id:
int- message: Union[
str,SystemDiscussionPostMessage] String when system is false and
SystemDiscussionPostMessageotherwise.
system:
boolbeatmap_discussion: Optional[
BeatmapsetDiscussion]- message: Union[
- class osu.BeatmapsetDiscussionVote(data)¶
Represents a vote on a
BeatmapsetDiscussion.Attributes
beatmapset_discussion_id:
intcreated_at:
datetime.datetimeid:
intscore:
intupdated_at:
datetime.datetimeuser_id:
int
- class osu.BeatmapsetEvent(data)¶
Represent a beatmapset event. This object is relevant for the
osu.Client.get_beatmapset_events()endpoint.Attributes
id:
inttype:
BeatmapsetEventType- comment: Optional[
BeatmapsetEventComment] Is None for the following types: -
BeatmapsetEventType.LOVE -BeatmapsetEventType.QUALIFY -BeatmapsetEventType.APPROVE -BeatmapsetEventType.RANK
created_at:
datetime.datetimeuser_id: Optional[
int]beatmapset: Optional[
BeatmapsetCompact]discussion: Optional[
BeatmapsetDiscussion]- comment: Optional[
- class osu.BeatmapsetEventComment(data, type: BeatmapsetEventType)¶
This object holds some extra information of the event.
Attributes
beatmap_discussion_id: Optional[
int]beatmap_discussion_post_id: Optional[
int]event_data: Union[
BeatmapsetEventNominate,BeatmapsetEventRemoveFromLoved,BeatmapsetEventDisqualify,BeatmapsetEventKudosuGain,BeatmapsetEventKudosuLost,BeatmapsetEventKudosuRecalculate,BeatmapsetEventDiscussionLock,BeatmapsetEventNominationReset,BeatmapsetEventNominationResetReceived,BeatmapsetEventGenreEdit,BeatmapsetEventLanguageEdit,BeatmapsetEventNsfwToggle,BeatmapsetEventOffsetEdit,BeatmapsetEventBeatmapOwnerChange]The type of this attribute depends on the type of the BeatmapsetEvent object.
- class osu.BeatmapsetEventNominate(data)¶
Attributes
modes: List[
GameModeStr]
- class osu.BeatmapsetEventRemoveFromLoved(data)¶
Attributes
reason:
str
- class osu.BeatmapsetEventDisqualify(data)¶
Attributes
nominator_ids: List[
int]
- class osu.BeatmapsetEventVote(data)¶
Attributes
user_id:
intscore:
int
- class osu.BeatmapsetEventKudosuGain(data)¶
Attributes
new_votes: Optional[
BeatmapsetEventVote]votes: Optional[List[
BeatmapsetEventVote]]
- class osu.BeatmapsetEventKudosuLost(data)¶
Attributes
new_votes: Optional[
BeatmapsetEventVote]votes: Optional[List[
BeatmapsetEventVote]]
- class osu.BeatmapsetEventKudosuRecalculate(data)¶
Attributes
new_votes: Optional[
BeatmapsetEventVote]
- class osu.BeatmapsetEventDiscussionLock(data)¶
Attributes
reason:
str
- class osu.BeatmapsetEventNominationReset(data)¶
Attributes
nominator_ids: List[
int]
- class osu.BeatmapsetEventNominationResetReceived(data)¶
Attributes
source_user_id:
intsource_user_name:
str
- class osu.BeatmapsetEventGenreEdit(data)¶
Attributes
old:
strnew:
str
- class osu.BeatmapsetEventLanguageEdit(data)¶
Attributes
old:
strnew:
str
- class osu.BeatmapsetEventNsfwToggle(data)¶
Attributes
old:
strnew:
str
- class osu.BeatmapsetEventOffsetEdit(data)¶
Attributes
old:
strnew:
str
- class osu.BeatmapsetEventBeatmapOwnerChange(data)¶
Attributes
beatmap_id:
intbeatmap_version:
strnew_user_id:
intnew_user_username:
str
- class osu.BeatmapsetPermissions(data)¶
User permissions on a beatmapset
Attributes
can_beatmap_update_owner:
boolcan_delete:
boolcan_edit_metadata:
boolcan_edit_offset:
boolcan_edit_tags:
boolcan_hype:
boolcan_hype_reason:
strcan_love:
boolcan_remove_from_loved:
boolis_watching:
boolnew_hype_time: Optional[
str]- nomination_modes: Dict[
GameModeStr,str] Values are either “full” or “limited”.
remaining_hype:
int- nomination_modes: Dict[
- class osu.BeatmapsetRequirement(data)¶
Gives information on requirements for a beatmap
Attributes
current:
int- required: Optional[
int] If this is None, then required_meta and eligible_main_rulesets should have values
required_meta: Optional[
BeatmapsetRequiredNominations]eligible_main_rulesets: Optional[List[
GameModeStr]]- required: Optional[
- … autoclass:: osu.BeatmapsetRequiredNominations
- members:
- class osu.BeatmapsetReviveEvent(data)¶
Attributes
beatmapset:
EventBeatmapsetuser:
EventUser
- class osu.BeatmapsetUpdateEvent(data)¶
Attributes
beatmapset:
EventBeatmapsetuser:
EventUser
- class osu.BeatmapsetUploadEvent(data)¶
Attributes
beatmapset:
EventBeatmapsetuser:
EventUser
- class osu.BeatmapUserScore(data)¶
Attributes
- position:
int The position of the score within the requested beatmap ranking.
- score:
LegacyScore The details of the score.
- position:
- class osu.Build(data)¶
Attributes
created_at:
datetime.datetimedisplay_version:
strid:
intupdate_stream: Optional[
UpdateStream]users:
intversion Optional[
str]- changelog_entries: Optional[List[
ChangelogEntry]] If the build has no changelog entries, a placeholder is generated.
versions: Optional[
Versions]- changelog_entries: Optional[List[
- class osu.ChangelogEntry(data)¶
Attributes
category:
strcreated_at: Optional[
datetime.datetime]github_pull_request_id: Optional[
int]github_url: Optional[
str]id: Optional[
int]major:
boolrepository: Optional[
str]title: Optional[
str]type:
strurl: Optional[
str]- github_user: Optional[
GithubUser] If the changelog entry has no GitHub user, a placeholder is generated.
- message: Optional[
str] Entry message in Markdown format. Embedded HTML is allowed.
- message_html: Optional[
str] Entry message in HTML format.
- github_user: Optional[
- class osu.ChatChannel(data)¶
Represents an individual chat “channel” in the game.
Attributes
channel_id:
intname:
strdescription: Optional[
str]- icon: Optional[
str] display icon for the channel
- type:
ChatChannelType Below are the channel types and their permission checks for joining/messaging: PUBLIC
None
- PRIVATE
is player in the allowed groups? (channel.allowed_groups)
- MULTIPLAYER
is player currently in the mp game?
- SPECTATOR
None
- TEMPORARY
deprecated
- PM
For PMs, two factors are taken into account: Is either user blocking the other? If so, deny. Does the target only accept PMs from friends? Is the current user a friend? If not, deny.
- GROUP
is player in channel? (user_channels)
- ANNOUNCE
is user in the announce group?
- moderated:
bool user can’t send message when the value is True
- uuid: Optional[
str] value from requests that is relayed back to the sender.
- current_user_attributes: Optional[
ChatChannelUserAttributes] only present on some responses
- last_message_id: Optional[
int] message_id of last known message (only returned in presence responses)
- recent_messages: Optional[List[
ChatMessage]] [DEPRECATED] up to 50 most recent messages
- users: Optional[List[
int]] list of user ids that are in the channel (not included for PUBLIC channels).
- icon: Optional[
- class osu.ChatChannelUserAttributes(data)¶
Data about a user related to a chat channel.
Attributes
can_message:
boolcan_message_error: Optional[
str]last_read_id: Optional[
int]
- class osu.ChatMessage(data)¶
Represents an individual Message within a
ChatChannel.Attributes
- channel_id:
int channel_id of where the message was sent
- content:
str message content
- is_action:
bool was this an action? i.e. /me dances
- message_id:
int unique identifier for message
- sender_id:
int user_id of the sender
- timestamp:
datetime.datetime when the message was sent
type:
ChatMessageType- uuid: Optional[
str] message identifier originally sent by client
- sender: Optional[
UserCompact] embedded
UserCompactobject to save additional api lookups
- channel_id:
- class osu.Comment(data)¶
Represents a single comment.
Attributes
- commentable_id:
int ID of the object the comment is attached to
- commentable_type:
str type of object the comment is attached to
created_at:
datetime.datetimedeleted_at: Option[
datetime.datetime]- deleted_by_id: Optional[
int] user id of the user that deleted the post; null, otherwise
edited_at: Optional[
datetime.datetime]- edited_by_id: Optional[
int] user id of the user that edited the post; null, otherwise
- id:
int the ID of the comment
- legacy_name: Optional[
str] username displayed on legacy comments
- message: Optional[
str] markdown of the comment’s content
- message_html: Optional[
str] html version of the comment’s content
- parent_id: Optional[
int] ID of the comment’s parent
- pinned:
bool Pin status of the comment
- replies_count:
int number of replies to the comment
updated_at:
datetime.datetimeuser: Optional[
UserCompact]- user_id:
int user ID of the poster
- votes_count:
int number of votes
- url:
str URL to the comment
- commentable_id:
- class osu.CommentableMeta(data)¶
Metadata of the object that a comment is attached to. If the object is deleted then title is the only attribute with a value.
Attributes
- id: Optional[
int] the ID of the object
- owner_id: Optional[
int] the ID of the owner of the object
- owner_title: Optional[
int] undocumented
- title: Optional[
str] display title
- type: Optional[
str] the type of the object
- url: Optional[
str] url of the object
current_user_attributes:
CommentableMetaAttributes- id: Optional[
- class osu.CommentableMetaAttributes(data)¶
User attributes for a
CommentableMetaobjectAttributes
can_new_comment_reason: Optional[
str]
- class osu.CommentBundle(data)¶
Comments and related data.
Attributes
- commentable_meta: List[
CommentableMeta] ID of the object the comment is attached to
- comments: List[
Comment] List of comments ordered according to sort
- has_more:
bool If there are more comments or replies available
has_more_id:
int- included_comments: List[
Comment] Related comments; e.g. parent comments and nested replies
- pinned_comments: List[
Comment] Pinned comments
sort:
CommentSort- top_level_count: Optional[
int] Number of comments at the top level. Not returned for replies.
- total: Optional[
int] Total number of comments. Not returned for replies.
- user_follow:
bool is the current user watching the comment thread?
- user_votes: List[
int] IDs of the comments in the bundle the current user has upvoted
- users: List[
UserCompact] List of users related to the comments
- commentable_meta: List[
- class osu.Country(data)¶
Country data
Attributes
code:
strname:
strdisplay: Optional[
int]
- class osu.Covers(data)¶
Attributes
cover:
strcover_2x:
strcard:
strcard_2x:
strlist:
strlist_2x:
strslimcover:
strslimcover_2x:
str
- class osu.CurrentNomination(data)¶
Info about a nomination
Attributes
beatmapset_id:
intrulesets: Optional[List[
GameModeStr]]reset:
booluser_id:
int
- class osu.CurrentUserPin(data)¶
Gives info about a score related to if it’s pinned or not
Attributes
is_pinned:
boolscore_id:
intscore_type: Optional[
ObjectType]
- class osu.Event(data)¶
Base class of an event
Attributes
created_at:
datetime.datetimeid:
int- type:
All types and the additional attributes they provide are listed under ‘Event Types’
- class osu.EventUser(data)¶
Attributes
username:
strurl:
str- previous_username: Optional[
str] Only for UsernameChangeEvent.
- previous_username: Optional[
- class osu.EventBeatmap(data)¶
Attributes
title:
strurl:
str
- class osu.EventBeatmapset(data)¶
Attributes
title:
strurl:
str
- class osu.Failtimes(data)¶
Attributes
- exit: Optional[List[
int]] List of 100 integers.
- fail: Optional[List[
int]] List of 100 integers.
- exit: Optional[List[
- class osu.ForumPost(data)¶
Attributes
created_at:
datetime.datetimedeleted_at: Optional[
datetime.datetime]edited_at: Optional[
datetime.datetime]edited_by_id: Optional[
int]forum_id:
intid:
inttopic_id:
intuser_id:
intbody: Optional[
TextFormat]
- class osu.ForumTopic(data)¶
Attributes
created_at:
datetime.datetimedeleted_at: Optional[
datetime.datetime]first_post_id:
intforum_id:
intid:
intis_locked:
boollast_post_id:
intpoll: Optional[
Poll]post_count:
inttitle:
strtype:
ForumTopicTypeupdated_at:
datetime.datetimeuser_id:
int
- class osu.FruitsBeatmapDifficultyAttributes(data)¶
osu!catch beatmap difficulty attributes. See
BeatmapDifficultyAttributesfor more information.Attributes
approach_rate:
float
- class osu.GithubUser(data)¶
Attributes
display_name:
strgithub_url: Optional[
str]id: Optional[
int]osu_username: Optional[
str]user_id: Optional[
int]user_url: Optional[
str]
- class osu.Group(data)¶
This object isn’t returned by any endpoints yet, it is here purely as a reference for
UserGroupAttributes
id:
int- identifier:
str Unique string to identify the group.
- is_probationary:
bool Whether members of this group are considered probationary.
- has_playmodes:
bool If this group associates GameModes with a user’s membership, e.g. BN/NAT members
- has_listing:
bool Whether this group displays a listing at /groups/{id}
name:
str- short_name:
str Short name of the group for display.
colour: Optional[
str]- description: Optional[
TextFormat] A dictionary with keys html and markdown.
- identifier:
- class osu.KudosuHistory(data)¶
Attributes
id:
intaction:
KudosuActionamount:
int- model:
ObjectType Object type which the exchange happened on (forum_post, etc).
created_at:
datetime.datetime- giver: Optional[
KudosuGiver] Simple detail of the user who started the exchange.
- post:
KudosuPost Simple detail of the object for display.
- model:
- class osu.LegacyNominations(data)¶
Shows info about nominations on a beatmapset, extending
BaseNominationsAttributes
- is_legacy:
bool True
current:
intrequired:
int- is_legacy:
- class osu.LegacyScore(data)¶
Contains information about a score
Attributes
id:
intbest_id:
intuser_id:
intaccuracy:
floatmods:
Modsscore:
intmax_combo:
intperfect:
boolstatistics:
ScoreStatisticspassed
boolpp:
floatrank:
ScoreRankcreated_at:
datetime.datetimemode:
GameModeStrmode_int:
GameModeInt- has_replay:
bool is the replay is available
beatmap: Optional[
BeatmapCompact]beatmapset: Optional[
BeatmapsetCompact]rank_country: Optional[
int]rank_global: Optional[
int]weight: Optional[
PpWeight]user: Optional[
UserCompact]match: Optional[
MatchGameScoreInfo]current_user_attributes: Optional[
ScoreUserAttributes]- has_replay:
- class osu.ManiaBeatmapDifficultyAttributes(data)¶
osu!mania beatmap difficulty attributes. See
BeatmapDifficultyAttributesfor more information.Attributes
great_hit_window:
floatscore_multiplier:
float
- class osu.Match(data)¶
Info of a match, relevant at
osu.Client.get_matches().Attributes
id:
intname:
strstart_time: Optional[
datetime.datetime]end_time: Optional[
datetime.datetime]
- class osu.MatchEvent(data)¶
An event that occurred in a match.
Attributes
id:
inttimestamp:
datetime.datetimeuser_id:
inttype:
MatchEventType- text: Optional[
str] None unless the event type is
MatchEventType.OTHER- game: Optional[
MatchGame] None unless the event type is
MatchEventType.OTHER
- text: Optional[
- class osu.MatchExtended(data)¶
Extended version of
Matchthat is relevant at theosu.Client.get_match()endpoint.Attributes
- events: List[
MatchEvent] List of events that occurred in the match.
users: List[
UserCompact]first_event_id:
intlatest_event_id:
intcurrent_game_id:
int- events: List[
- class osu.MatchGame(data)¶
Represents a map played in a match and contains all the info about the game
Attributes
beatmap_id:
intid:
intstart_time: Optional[
datetime.datetime]end_time: Optional[
datetime.datetime]mode:
GameModeStrmode_int:
GameModeIntscoring_type:
ScoringTypeteam_type:
TeamTypemods:
Modsbeatmap: Optional[
BeatmapCompact]scores: List[
LegacyScore]
- class osu.MatchGameScoreInfo(data)¶
Says info about a score set in a match. Is an attribute of
LegacyScoreAttributes
slot:
intteam:
strpassed:
bool
- class osu.MetadataAttribute(data)¶
Genre of a beatmapset
Attributes
id: Optional[
int]name:
str
- class osu.MultiplayerScores(data)¶
An object which contains scores and related data for fetching next page of the result.
Attributes
- cursor:
str To be used to fetch the next page.
- params:
dict To be used to fetch the next page.
scores: List[
MultiplayerScore]- total: Optional[
int] Index only. Total scores of the specified playlist item.
- user_score: Optional[
MultiplayerScore] Index only. Score of the accessing user if exists.
- cursor:
- class osu.MultiplayerScoresAround(data)¶
Attributes
higher:
MultiplayerScoreslower:
MultiplayerScores
- class osu.NewsPost(data)¶
Attributes
author:
str- edit_url:
str Link to the file view on GitHub.
- first_image: Optional[
str] Link to the first image in the document.
id:
intpublished_at:
datetime.datetime- slug:
str Filename without the extension, used in URLs.
title:
strupdated_at:
datetime.datetime- content: Optional[
str] HTML post content.
- navigation: Optional[
Navigation] Navigation metadata.
- preview: Optional[
str] First paragraph of content with HTML markup stripped.
- edit_url:
Attributes
- class osu.Nominations(data)¶
Shows info about nominations on a beatmapset, extending
BaseNominationsAttributes
- is_legacy:
bool False
current: Union[
int, Dict[GameModeStr,int]]required:
int- is_legacy:
- class osu.Notification(data)¶
Represents a notification object. Go to
Detailsobject to see details for each eventAttributes
id:
int- name:
NotificationType The type of event
created_at:
datetime.datetimeobject_type:
ObjectTypeobject_id:
intsource_user_id: Optional[
int]is_read:
booldetails: Union[
BeatmapOwnerChangeDetails,BeatmapsetDiscussionLockDetails,BeatmapsetDiscussionPostNewDetails,BeatmapsetDiscussionQualifiedProblemDetails,BeatmapsetDiscussionReviewNewDetails,BeatmapsetDiscussionUnlockDetails,BeatmapsetDisqualifyDetails,BeatmapsetLoveDetails,BeatmapsetNominateDetails,BeatmapsetQualifyDetails,BeatmapsetRankDetails,BeatmapsetRemoveFromLovedDetails,BeatmapsetResetNominationsDetails,ChannelAnnouncementDetails,ChannelMessageDetails,CommentNewDetails,ForumTopicReplyDetails,UserAchievementUnlockDetails,UserBeatmapsetNewDetails,UserBeatmapsetReviveDetails]Details of the notification.
Documented event names and their attribute meanings
- beatmapset_discussion_lock
object_id: Beatmapset id object_type: beatmapset source_user_id: User who locked discussion
- beatmapset_discussion_post_new
object_id: Beatmapset id object_type: beatmapset source_user_id: Poster of the discussion
- beatmapset_discussion_unlock
object_id: Beatmapset id object_type: beatmapset source_user_id: User who unlocked discussion
- beatmapset_disqualify
object_id: Beatmapset id object_type: beatmapset source_user_id: User who disqualified beatmapset
- beatmapset_love
object_id: Beatmapset id object_type: beatmapset source_user_id: User who promoted beatmapset to Loved
- beatmapset_nominate
object_id: Beatmapset id object_type: beatmapset source_user_id: User who nominated beatmapset
- beatmapset_qualify
object_id: Beatmapset id object_type: beatmapset source_user_id: User whom beatmapset nomination triggered qualification
- beatmapset_remove_from_loved
object_id: Beatmapset id object_type: beatmapset source_user_id: User who removed beatmapset from Loved
- beatmapset_reset_nominations
object_id: Beatmapset id object_type: beatmapset source_user_id: User who locked discussion
- channel_message
object_id: Channel id object_type: channel source_user_id: User who posted message
- forum_topic_reply
object_id: Topic id object_type: forum_topic source_user_id: User who posted message
- name:
- class osu.OsuBeatmapDifficultyAttributes(data)¶
osu!standard beatmap difficulty attributes. See
BeatmapDifficultyAttributesfor more information.Attributes
aim_difficulty:
floatapproach_rate:
floatflashlight_difficulty:
floatoverall_difficulty:
floatslider_factor:
floatspeed_difficulty:
floatspeed_note_count:
float
- class osu.PlaylistItem(data)¶
Attributes
id:
introom_id:
intbeatmap_id:
intruleset_id:
GameModeIntallowed_mods: List[
LazerMod]required_mods: List[
LazerMod]expired:
boolowner_id:
intplaylist_order: Optional[
int]played_at: Optional[
datetime.datetime]beatmap: Optional[
BeatmapCompact]
- class osu.PlaylistItemStats(data)¶
Attributes
count_active:
intcount_total:
intruleset_ids: List[
GameModeInt]
- class osu.Poll(data)¶
Attributes
allow_vote_change:
boolended_at: Optional[
datetime.datetime]hide_incomplete_results:
boollast_vote_at: Optional[
datetime.datetime]max_votes:
intoptions: List[
PollOption]started_at:
datetime.datetimetitle:
TextFormattotal_vote_count:
int
- class osu.PollOption(data)¶
Attributes
id:
inttext:
TextFormat- vote_count: Optional[
int] Not present if the poll is incomplete and results are hidden.
- vote_count: Optional[
- class osu.PpWeight(data)¶
Weighted pp info
Attributes
- percentage:
int number (0-100) that tells percentage weighed
- pp:
float amount of pp after being weighted
- percentage:
- class osu.ProfileBanner(data)¶
Attributes
id:
inttournament_id:
intimage: Optional[
str]image2x: Optional[
str]
- class osu.RankEvent(data)¶
Attributes
score_rank:
strrank:
intmode:
GameModeStrbeatmap:
EventBeatmapuser:
EventUser
- class osu.RankHighest(data)¶
Highest rank a player achieved at any point in time.
Attributes
rank:
intupdated_at:
datetime.datetime
- class osu.RankHistory(data)¶
Rank history data for a user
Attributes
mode:
GameModeStr- data: List[
int] List of ranks from oldest to newest
- data: List[
- class osu.Rankings(data)¶
Attributes
- beatmapsets: Optional[List[
Beatmapset]] The list of beatmaps in the requested spotlight for the given mode; only available if type is charts
- cursor: Dict
To be used to query the next page
- ranking: List[
UserStatistics] Score details ordered by rank in descending order.
- spotlight: Optional[
Spotlight] Spotlight details; only available if type is charts
- total:
int An approximate count of ranks available
- beatmapsets: Optional[List[
- class osu.RankLostEvent(data)¶
Attributes
mode:
GameModeStrbeatmap:
EventBeatmapuser:
EventUser
- class osu.ReadNotification(data)¶
Represents a read notification.
Attributes
category:
NotificationCategoryid:
intobject_id:
intobject_type:
ObjectType
- class osu.Review(data)¶
Attributes
max_blocks:
int
- class osu.Room(data)¶
osu.Client.get_rooms()andosu.Client.get_room()endpoints include host, playlist, and recent_participants attributes. In addition, thePlaylistItemobjects in playlist include the beatmap attribute and the beatmap attribute has the beatmapset, checksum, and max_combo attributes.Attributes
id:
intname:
strcategory:
RoomCategorytype:
RoomType- realtime_type:
RealTimeType Only applicable when type is RoomType.REALTIME
user_id:
intstarts_at: Optional[
datetime.datetime]ends_at: Optional[
datetime.datetime]max_attempts:
intparticipant_count:
intchannel_id:
intactive:
boolhas_password:
bool- queue_mode: Union[
RealTimeQueueMode,PlaylistQueueMode] Type depends on the room type.
PlaylistQueueModefor typeRoomType.PLAYLIST andRealTimeQueueModeotherwise.
current_playlist_item: Optional[
PlaylistItem]current_user_score: Optional[
UserScoreAggregate]- difficulty_range: Optional[Dict[
str,int]] When not none, is a dictionary containing keys “max” and “min”
host: Optional[
UserCompact]playlist: Optional[List[
PlaylistItem]]playlist_item_stats: Optional[
PlaylistItemStats]recent_participants: Optional[List[
UserCompact]]scores: Optional[
MultiplayerScore]- realtime_type:
- class osu.Scope(*scopes)¶
Scope object for telling the program what scopes you are using
Valid scopes
- public
Allows reading of publicly available data on behalf of the user.
- identify (default)
Allows reading of the public profile of the user (/me).
- friends.read
Allows reading of the user’s friend list.
- forum.write
Allows creating and editing forum posts on a user’s behalf.
- delegate
Allows acting as the owner of a client; only available for Client Credentials Grant.
- chat.write
Allows sending chat messages on a user’s behalf.
- class osu.ScoreDataStatistics(data)¶
Attributes
ok: Optional[
int]meh: Optional[
int]good: Optional[
int]miss: Optional[
int]none: Optional[
int]great: Optional[
int]perfect: Optional[
int]ignore_hit: Optional[
int]ignore_miss: Optional[
int]large_bonus: Optional[
int]small_bonus: Optional[
int]large_tick_hit: Optional[
int]small_tick_hit: Optional[
int]large_tick_miss: Optional[
int]small_tick_miss: Optional[
int]
- class osu.ScoreStatistics(data)¶
Attributes
count_50:
intcount_100:
intcount_300:
intcount_geki:
intcount_katu:
intcount_miss:
int
- class osu.ScoreUserAttributes(data)¶
Gives info about a score related to the current user
Attributes
Optional[
CurrentUserPin]
- class osu.SearchResults(data, data_type)¶
Represents the results of a search.
Attributes
- results: List[Union[
UserCompact,WikiPage]] type depends on search type
total:
int- results: List[Union[
- class osu.SoloScore(data)¶
Contains information about a lazer score.
Attributes
accuracy:
floatbeatmap_id: Optional[
int]ended_at:
datetime.datetimemax_combo:
intmaximum_statistics:
ScoreDataStatisticsmods: List[
LazerMod]passed:
boolrank:
ScoreRankruleset_id:
intstatistics:
ScoreDataStatisticstotal_score:
intuser_id:
intbest_id: Optional[
int]id:
intlegacy_perfect: Optional[
bool]pp: Optional[
float]replay:
booltype:
ObjectTypeuser: Optional[
UserCompact]build_id: Optional[
int]legacy_score_id: Optional[
int]legacy_total_score: Optional[
int]started_at: Optional[
datetime.datetime]current_user_attributes: Optional[
ScoreUserAttributes]weight: Optional[
PpWeight]
- class osu.Spotlight(data)¶
The details of a spotlight.
Attributes
- end_date:
datetime.datetime In DateTime format. The end date of the spotlight.
- id:
int The ID of this spotlight.
- mode_specific:
bool If the spotlight has different modes specific to each game mode.
- participant_count: Optional[
int] The number of users participating in this spotlight. This is only shown when viewing a single spotlight.
- name:
str The name of the spotlight.
- start_date:
datetime.datetime In DatTime format. The starting date of the spotlight.
- type:
str The type of spotlight.
- end_date:
- class osu.SystemDiscussionPostMessage(data)¶
System message of
BeatmapsetDiscussionPostAttributes
type:
strvalue:
bool
- class osu.TaikoBeatmapDifficultyAttributes(data)¶
osu!taiko beatmap difficulty attributes. See
BeatmapDifficultyAttributesfor more information.Attributes
stamina_difficulty:
floatrhythm_difficulty:
floatcolour_difficulty:
floatgreat_hit_window:
floatpeak_difficulty:
float
- class osu.TextFormat(data)¶
A page that has html and raw data
Attributes
html:
strraw:
str
- class osu.UpdateStream(data)¶
Attributes
display_name: Optional[
str]id:
intis_featured:
boolname:
strlatest_build: Optional[
Build]user_count: Optional[
int]
- class osu.User(data)¶
Represents a User. Extends
UserCompactwith additional attributes. Includes country, cover, and is_restricted attributes ofUserCompact.Attributes
- cover_url:
str url of profile cover. Deprecated, use cover.url instead.
discord: Optional[
str]- has_supported:
bool Has been a supporter in the past
interests: Optional[
str]join_date:
datetime.datetimekudosu:
UserKudosulocation: Optional[
str]- max_blocks:
int maximum number of users allowed to be blocked
- max_friends:
int maximum number of friends allowed to be added
occupation: Optional[
str]playmode:
GameModeStr- playstyle: List[
str] Device choices of the user.
- post_count:
int number of forum posts
- profile_order: List[
str] Ordered list of sections in user profile page. Sections consist of: me, recent_activity, beatmaps, historical, kudosu, top_ranks, medals
- title: Optional[
str] user-specific title
title_url: Optional[
str]twitter: Optional[
str]website: Optional[
str]- cover_url:
- class osu.UserCompact(data)¶
Mainly used for embedding in certain responses to save additional api lookups.
Attributes
- avatar_url:
str url of user’s avatar
- country_code:
str two-letter code representing user’s country
- default_group:
str Identifier of the default Group the user belongs to.
- id:
int unique identifier for user
- is_active:
bool has this account been active in the last x months?
- is_bot:
bool is this a bot account?
is_deleted:
bool- is_online:
bool is the user currently online? (either on lazer or the new website)
- is_supporter:
bool does this user have supporter?
- last_visit: Optional[
datetime.datetime] null if the user hides online presence
- pm_friends_only:
bool whether or not the user allows PM from other than friends
- profile_colour: Optional[
str] colour of username/profile highlight, hex code (e.g. #333333)
- username:
str user’s display name
account_history: Optional[List[
UserAccountHistory]]- active_tournament_banner: Optional[
ProfileBanner] deprecated; use active_tournament_banners
active_tournament_banners: Optional[List[
ProfileBanner]]badges: Optional[List[
UserBadge]]beatmap_playcounts_count: Optional[
int]blocks: Optional[List[
UserRelations]]comments_count: Optional[
int]country: Optional[
Country]cover: Optional[
UserCover]daily_challenge_user_stats: Optional[
DailyChallengeUserStats]favourite_beatmapset_count: Optional[
int]follow_user_mapping: Optional[List[
int]]follower_count: Optional[
int]friends: Optional[List[UserRelations]]
graveyard_beatmapset_count: Optional[
int]groups: Optional[List[
UserGroup]]guest_beatmapset_count: Optional[
int]is_admin: Optional[
bool]is_bng: Optional[
bool]is_gmt: Optional[
bool]is_limited_bn: Optional[
bool]is_moderator: Optional[
bool]is_nat: Optional[
bool]is_restricted: Optional[
bool]is_silenced: Optional[
bool]loved_beatmapset_count: Optional[
int]mapping_follower_count: Optional[
int]monthly_playcounts: Optional[List[
UserMonthlyPlaycount]]nominated_beatmapset_count: Optional[
int]page: Optional[
TextFormat]pending_beatmapset_count: Optional[
int]previous_usernames: Optional[List[
str]]rank_highest: Optional[
RankHighest]rank_history: Optional[
RankHistory]ranked_beatmapset_count: Optional[
int]replays_watched_counts: Optional[List[
UserReplaysWatchedCount]]scores_best_count: Optional[
int]scores_first_count: Optional[
int]scores_pinned_count: Optional[
int]scores_recent_count: Optional[
int]statistics: Optional[
UserStatistics]statistics_rulesets: Optional[
UserStatisticsRulesets]support_level: Optional[
int]unread_pm_count: Optional[
int]user_achievements: Optional[List[
UserAchievement]]user_preferences: Optional[
UserPreferences]- avatar_url:
- class osu.UserCover(data)¶
Cover of a user’s profile
Attributes
custom_url: Optional[
str]url: Optional[
str]id: Optional[
int]
- class osu.UserAccountHistory(data)¶
Attributes
actor: Optional[
UserCompact]description:
strid:
intlength:
intpermanent:
boolsupporting_url: Optional[
str]timestamp:
datetime.datetimetype:
UserAccountHistoryType
- class osu.UserAchievement(data)¶
An achievement that a user received
Attributes
achieved_at:
datetime.datetimeachievement_id:
int
- class osu.UserBadge(data)¶
Attributes
awarded_at:
datetime.datetimedescription:
strimage_url:
strimage_2x_url:
strurl:
str
- class osu.UserGroup(data)¶
Describes the
Groupmembership of aUser. It contains all of the attributes of theGroup, in addition to what is listed here.Attributes
- playmodes: Optional[List[
GameModeStr]] GameModes associated with this membership (None if has_playmodes is false).
- playmodes: Optional[List[
- class osu.UserKudosu(data)¶
User kudosu data
Attributes
total:
intavailable:
int
- class osu.UserMonthlyPlaycount(data)¶
Attributes
- start_date:
datetime.date year-month-day format
- count: class:int
playcount
- start_date:
- class osu.UserPreferences(data)¶
The settings preferences of a user
audio_autoplay:
boolaudio_muted:
boolaudio_volume:
float- beatmapset_card_size:
str normal or extra
- beatmapset_download:
str all, no_video, or direct
beatmapset_show_nsfw:
boolbeatmapset_title_show_original:
boolcomments_show_deleted:
boolforum_posts_show_deleted:
boolprofile_cover_expanded:
bool- user_list_filter:
str all, online, or offline
- user_list_sort:
str last_visit, rank, or username
- user_list_view:
str brick, card, or list
- beatmapset_card_size:
- class osu.UserRelations(data)¶
Info about relationship to a user
Attributes
- target_id:
int zebra id
relation_type:
UserRelationTypemutual:
bool- target_id:
- class osu.UserReplaysWatchedCount(data)¶
The count of replays watched for a month
Attributes
start_date:
datetime.datetimecount:
int
- class osu.UserStatistics(data)¶
A summary of various gameplay statistics for a User. Specific to a
GameModeAttributes
count_300:
intcount_100:
intcount_50:
intcount_miss:
int- country_rank: Optional[
int] Current country rank according to pp.
- global_rank: Optional[
int] Current global rank according to pp.
- global_rank: Optional[
- global_rank_exp: Optional[
int] Current global rank according to experimental pp (not used anymore).
- grade_counts:
NamedTuple Below are the attributes and their meanings.
- a:
int Number of A ranked scores.
- s:
int Number of S ranked scores.
- sh:
int Number of Silver S ranked scores.
- ss:
int Number of SS ranked scores.
- ssh:
int Number of Silver SS ranked scores.
- a:
- hit_accuracy:
float Hit accuracy percentage
- is_ranked:
bool Does the player have a rank
- level:
NamedTuple Has attributes ‘current’ (current level) and ‘progress’ (progress to next level).
- maximum_combo:
int Highest maximum combo.
- play_count:
int Number of maps played.
- play_time:
int Cumulative time played.
- pp:
int Performance points
- pp_exp: Optional[
int] Experimental performance points (not used anymore)
rank_change_since_30_days: Optional[
int]- recommended_difficulty:
float Recommended difficulty for a player. This value is not received from the api, but locally calculated. The formula is pp^0.4 * 0.195
- recommended_difficulty_exp:
float Recommended difficulty based on the pp_exp value.
- ranked_score:
int Current ranked score.
- replays_watched_by_others:
int Number of replays watched by other users.
- total_hits:
int Total number of hits.
- total_score:
int Total score.
- user: Optional[
UserCompact] The associated user.
variants: Optional[List[
UserStatisticVariant]]- country_rank: Optional[
- class osu.UserStatisticsRulesets(data)¶
Object that contains statistics for each gamemode.
Attributes
- osu: Optional[
UserStatistics] statistics for osu!standard.
- taiko: Optional[
UserStatistics] statistics for osu!taiko.
- fruits: Optional[
UserStatistics] statistics for osu!catch.
- mania: Optional[
UserStatistics] statistics for osu!mania.
- osu: Optional[
- class osu.UserStatisticVariant(data)¶
A variant ranking system.
Attributes
country_rank: Optional[
int]global_rank: Optional[
int]mode:
GameModeStrpp:
int- variant:
str 4k or 7k
- variant:
- class osu.Versions(data)¶
Optional Attributes
- class osu.VotersSummary(data)¶
Gives a summary of players who voted up and down on a discussion
Attributes
- down: List[
int] List of user IDs of users that downvoted
- up: List[
int] List of user IDs of users that upvoted
- down: List[
- class osu.VotesSummary(data)¶
Summarizes the votes of a discussion
Attributes
- down:
int Number of downvotes
- up:
int Number of upvotes
- voters:
VotersSummary summarizes who voted up and down
- down:
- class osu.WikiPage(data)¶
Represents a wiki article
Attributes
- available_locales: List[
str] All available locales for the article.
- layout:
str The layout type for the page.
- locale:
str All lowercase BCP 47 language tag.
- markdown:
str Markdown content.
- path:
str Path of the article.
- subtitle: Optional[
str] The article’s subtitle.
- tags: List[
str] Associated tags for the article.
- title:
str The article’s title.
- available_locales: List[
Utility¶
- class osu.BeatmapsetSearchFilter¶
Util class that helps for filtering in
Client.search_beatmapsets().Read about each filter under its corresponding function.
All set functions return the instance of the class to allow for chaining.
- property filters: dict¶
Dictionary of all filters only including ones that have been set.
- set_extra(extras: Sequence[BeatmapsetSearchExtra | str]) BeatmapsetSearchFilter¶
Set the extras to filter by.
extras: Sequence[Union[
BeatmapsetSearchExtra,str]]
- set_generals(generals: Sequence[BeatmapsetSearchGeneral | str]) BeatmapsetSearchFilter¶
Set the generals to filter by.
generals: Sequence[Union[
BeatmapsetSearchGeneral,str]]
- set_genre(genre: BeatmapsetGenre | int) BeatmapsetSearchFilter¶
Set the genre to filter by.
genre:
str
- set_language(language: BeatmapsetLanguage | int) BeatmapsetSearchFilter¶
Set the language to filter by.
language:
str
- set_mode(mode: GameModeInt | int) BeatmapsetSearchFilter¶
Set the game mode to filter by.
mode: Union[
GameModeStr,str]
- set_nsfw(nsfw: bool) BeatmapsetSearchFilter¶
Set whether to include NSFW in the search.
nsfw:
bool
- set_played(played: BeatmapsetSearchPlayed | str) BeatmapsetSearchFilter¶
Set whether to include played and unplayed beatmapsets in the search.
played: Union[
BeatmapsetSearchPlayed,str]
- set_query(query: str) BeatmapsetSearchFilter¶
Set the query to search for.
query:
str
- set_ranked(rank: ScoreRank | str) BeatmapsetSearchFilter¶
Filter by rank achieved.
rank: Union[
ScoreRank,str]
- set_sort(sort: BeatmapsetSearchSort | str) BeatmapsetSearchFilter¶
Set the sort order of the search.
sort: Union[
BeatmapsetSearchSort,str]
- set_status(status: BeatmapsetSearchStatus | str) BeatmapsetSearchFilter¶
Set the status to filter by.
status: Union[
BeatmapsetSearchStatus,str]
- class osu.IdentitiesUtil(category: NotificationCategory | str | None = None, object_id: str | None = None, object_type: ObjectType | str | None = None)¶
Init parameters
- category: Optional[Union[
str,NotificationCategory]] Notification category.
- object_id: Optional[
str] Id of the object that triggered the notification
- object_type: Optional[Union[
str,ObjectType]] Type of the object that triggered the notification
- category: Optional[Union[
- class osu.NotificationsUtil(category: NotificationCategory | str | None = None, id: int | None = None, object_id: str | None = None, object_type: ObjectType | str | None = None)¶
Init parameters
- category: Optional[Union[
str,NotificationCategory]] Notification category.
- id: Optional[
id] Id of notification to be marked as read
- object_id: Optional[
str] Id of the object that triggered the notification
- object_type: Optional[Union[
str,ObjectType]] Type of the object that triggered the notification
- category: Optional[Union[
- class osu.PlaylistItemUtil(beatmap_id: int, ruleset_id: GameModeInt | int, allowed_mods: Sequence[Mod] | None = None, required_mods: Sequence[Mod] | None = None)¶
Util class for passing playlist items to endpoints that involve creating a room like create_multiplayer_room and create_playlist.
Init Parameters
beatmap_id:
intruleset_id: Union[
GameModeInt,int]allowed_mods: Sequence[
Mod]required_mods: Sequence[
Mod]Properties
- json:
dict Dictionary format of all the attributes which the client uses when sending a http request
- json:
Notifications¶
- class osu.BeatmapOwnerChangeDetails(data)¶
When ownership of a beatmap is transferred (for guest difficulties).
Extends
NotificationsDetailsBaseAttributes
beatmap_id:
intcover_url:
strtitle:
strtitle_unicode:
strversion:
str
- class osu.BeatmapsetDiscussionLockDetails(data)¶
Beatmapset discussion locked
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetDiscussionPostNewDetails(data)¶
New beatmapset discussion post
- class osu.BeatmapsetDiscussionPostNotificationDetails(data)¶
Base class for a couple other detail objects.
Extends
NotificationsDetailsBaseAttributes
content:
strtitle:
strtitle_unicode:
strpost_id:
intdiscussion_id:
intbeatmap_id:
intcover_url:
str
- class osu.BeatmapsetDiscussionQualifiedProblemDetails(data)¶
Beatmapset discussion qualified problem
Extends
BeatmapsetDiscussionPostNotification
- class osu.BeatmapsetDiscussionReviewNewDetails(data)¶
New beatmapset discussion review.
Extends
NotificationsDetailsBaseAttributes
title:
strtitle_unicode:
strpost_id:
intdiscussion_id:
intbeatmap_id:
intcover_url:
strembeds:
ReviewStats
- class osu.BeatmapsetDiscussionUnlockDetails(data)¶
Beatmapset discussion unlocked
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetDisqualifyDetails(data)¶
Beatmapset disqualified
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetLoveDetails(data)¶
Beatmapset loved
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetNominateDetails(data)¶
Beatmapset nominated
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetNotificationDetails(data)¶
Base class for several other detail objects.
Extends
NotificationsDetailsBaseAttributes
title:
strtitle_unicode:
strcover_url:
str
- class osu.BeatmapsetQualifyDetails(data)¶
Beatmapset qualified
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetRankDetails(data)¶
Beatmapset ranked
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetRemoveFromLovedDetails(data)¶
Beatmapset removed from love
Extends
BeatmapsetNotificationDetails
- class osu.BeatmapsetResetNominationsDetails(data)¶
Beatmapset nominations reset
Extends
BeatmapsetNominateDetails
- class osu.ChannelAnnouncementDetails(data)¶
Chat channel announcement
Extends
NotificationsDetailsBaseAttributes
channel_id:
intname:
strtitle:
strtype:
ChatChannelTypecover_url:
str
- class osu.ChannelMessageDetails(data)¶
Chat channel message
Extends
NotificationsDetailsBaseAttributes
title:
strtype:
ChatChannelTypecover_url:
str
- class osu.CommentNewDetails(data)¶
New comment
Extends
NotificationsDetailsBaseAttributes
comment_id:
inttitle:
strcontent:
strcover_url:
str
- class osu.ForumTopicReplyDetails(data)¶
Forum topic reply
Extends
NotificationsDetailsBaseAttributes
title:
strpost_id:
intcover_url:
str
- class osu.Notification(data)¶
Represents a notification object. Go to
Detailsobject to see details for each eventAttributes
id:
int- name:
NotificationType The type of event
created_at:
datetime.datetimeobject_type:
ObjectTypeobject_id:
intsource_user_id: Optional[
int]is_read:
booldetails: Union[
BeatmapOwnerChangeDetails,BeatmapsetDiscussionLockDetails,BeatmapsetDiscussionPostNewDetails,BeatmapsetDiscussionQualifiedProblemDetails,BeatmapsetDiscussionReviewNewDetails,BeatmapsetDiscussionUnlockDetails,BeatmapsetDisqualifyDetails,BeatmapsetLoveDetails,BeatmapsetNominateDetails,BeatmapsetQualifyDetails,BeatmapsetRankDetails,BeatmapsetRemoveFromLovedDetails,BeatmapsetResetNominationsDetails,ChannelAnnouncementDetails,ChannelMessageDetails,CommentNewDetails,ForumTopicReplyDetails,UserAchievementUnlockDetails,UserBeatmapsetNewDetails,UserBeatmapsetReviveDetails]Details of the notification.
Documented event names and their attribute meanings
- beatmapset_discussion_lock
object_id: Beatmapset id object_type: beatmapset source_user_id: User who locked discussion
- beatmapset_discussion_post_new
object_id: Beatmapset id object_type: beatmapset source_user_id: Poster of the discussion
- beatmapset_discussion_unlock
object_id: Beatmapset id object_type: beatmapset source_user_id: User who unlocked discussion
- beatmapset_disqualify
object_id: Beatmapset id object_type: beatmapset source_user_id: User who disqualified beatmapset
- beatmapset_love
object_id: Beatmapset id object_type: beatmapset source_user_id: User who promoted beatmapset to Loved
- beatmapset_nominate
object_id: Beatmapset id object_type: beatmapset source_user_id: User who nominated beatmapset
- beatmapset_qualify
object_id: Beatmapset id object_type: beatmapset source_user_id: User whom beatmapset nomination triggered qualification
- beatmapset_remove_from_loved
object_id: Beatmapset id object_type: beatmapset source_user_id: User who removed beatmapset from Loved
- beatmapset_reset_nominations
object_id: Beatmapset id object_type: beatmapset source_user_id: User who locked discussion
- channel_message
object_id: Channel id object_type: channel source_user_id: User who posted message
- forum_topic_reply
object_id: Topic id object_type: forum_topic source_user_id: User who posted message
- name:
- class osu.NotificationsDetailsBase(data)¶
Base class for all Detail objects.
Attributes
username:
str
- class osu.ReadNotification(data)¶
Represents a read notification.
Attributes
category:
NotificationCategoryid:
intobject_id:
intobject_type:
ObjectType
- class osu.ReviewStats(data)¶
Attributes
praises:
intsuggestions:
intproblems:
int
- class osu.UserAchievementUnlockDetails(data)¶
New achievement unlocked
Extends
NotificationsDetailsBaseAttributes
achievement_id:
intachievement_mode: Optional[
GameModeStr]cover_url:
strslug:
strtitle:
struser_id:
int
- class osu.UserBeatmapsetNewDetails(data)¶
New beatmapset
Extends:
NotificationsDetailsBaseAttributes
beatmapset_id:
inttitle:
strtitle_unicode:
strcover_url:
str
- class osu.UserBeatmapsetReviveDetails(data)¶
User beatmapset revived
Extends
UserBeatmapsetNewDetails
Enums¶
- class osu.BeatmapsetEventSort(value)¶
Sort option for beatmapset events. Relevant to
osu.Client.get_beatmapset_events().Beatmapset event sorts
ASC = ‘id_asc’
DESC = ‘id_desc’
- class osu.BeatmapsetEventType(value)¶
Enum for beatmapset event types. Relevant to
osu.Client.get_beatmapset_events().Beatmapset event types
NOMINATE = ‘nominate’
LOVE = ‘love’
REMOVE_FROM_LOVED = ‘unlove’
QUALIFY = ‘qualify’
DISQUALIFY = ‘disqualify’
APPROVE = ‘approve’
RANK = ‘rank’
KUDOSU_ALLOW = ‘kudosu_allow’
KUDOSU_DENY = ‘kudosu_deny’
KUDOSU_GAIN = ‘kudosu_gain’
KUDOSU_LOST = ‘kudosu_lost’
KUDOSU_RECALCULATE = ‘kudosu_recalculate’
ISSUE_RESOLVE = ‘issue_resolve’
ISSUE_REOPEN = ‘issue_reopen’
DISCUSSION_LOCK = ‘discussion_lock’
DISCUSSION_UNLOCK = ‘discussion_unlock’
DISCUSSION_DELETE = ‘discussion_delete’
DISCUSSION_RESTORE = ‘discussion_restore’
DISCUSSION_POST_DELETE = ‘discussion_post_delete’
DISCUSSION_POST_RESTORE = ‘discussion_post_restore’
NOMINATION_RESET = ‘nomination_reset’
NOMINATION_RESET_RECEIVED = ‘nomination_reset_received’
GENRE_EDIT = ‘genre_edit’
LANGUAGE_EDIT = ‘language_edit’
NSFW_TOGGLE = ‘nsfw_toggle’
OFFSET_EDIT = ‘offset_edit’
BEATMAP_OWNER_CHANGE = ‘beatmap_owner_change’
- class osu.BeatmapsetGenre(value)¶
Genre of a beatmapsets
Genres
UNSPECIFIED = 1
VIDEO_GAME = 2
ANIME = 3
ROCK = 4
POP = 5
OTHER = 6
NOVELTY = 7
HIP_HOP = 9
ELECTRONIC = 10
METAL = 11
CLASSICAL = 12
FOLK = 13
JAZZ = 14
- class osu.BeatmapsetLanguage(value)¶
Language of a beatmapset
Languages
UNSPECIFIED = 1
ENGLISH = 2
JAPANESE = 3
CHINESE = 4
INSTRUMENTAL = 5
KOREAN = 6
FRENCH = 7
GERMAN = 8
SWEDISH = 9
SPANISH = 10
ITALIAN = 11
RUSSIAN = 12
POLISH = 13
OTHER = 14
- class osu.ChatChannelType(value)¶
Enum for type of
ChatChannelChat channel types
PUBLIC = “PUBLIC”
PRIVATE = “PRIVATE”
MULTIPLAYER = “MULTIPLAYER”
SPECTATOR = “SPECTATOR”
TEMPORARY = “TEMPORARY”
PM = “PM”
GROUP = “GROUP”
ANNOUNCE = “ANNOUNCE”
- class osu.ChatMessageType(value)¶
The type of a
ChatMessageChat message types
ACTION = “action”
MARKDOWN = “markdown”
PLAIN = “plain”
- class osu.ForumTopicType(value)¶
Enum for
ForumTopictype attribute.Forum topic types
NORMAL = “normal”
STICKY = “sticky”
ANNOUNCEMENT = “announcement”
- class osu.GameModeInt(value)¶
Enums for GameModes using their int values.
GameModes
STANDARD = 0
TAIKO = 1
CATCH = 2
MANIA = 3
- class osu.GameModeStr(value)¶
Enum for GameModes using their string names.
GameModes
STANDARD = ‘osu’
TAIKO = ‘taiko’
CATCH = ‘fruits’
MANIA = ‘mania’
- class osu.KudosuAction(value)¶
A type of action related to kudosu
Kudosu action types
GIVE = “give”
VOTE_GIVE = “vote.give”
RESET = “reset”
VOTE_RESET = “vote.reset”
REVOKE = “revoke”
VOTE_REVOKE = “vote.revoke”
RECALCULATE_RESET = “recalculate.reset”
- class osu.MatchEventType(value)¶
Enum for match event types.
Match event types
PLAYER_LEFT = ‘player-left’
PLAYER_JOINED = ‘player-joined’
PLAYER_KICKED = ‘player-kicked’
MATCH_CREATED = ‘match-created’
MATCH_DISBANDED = ‘match-disbanded’
HOST_CHANGED = ‘host-changed’
OTHER = ‘other’
- class osu.MatchSort(value)¶
Sort options for matches. Relevant to
osu.Client.get_matches().Match sort options
ASCENDING = “id_asc”
DESCENDING = “id_desc”
- class osu.MessageType(value)¶
A type of message in beatmapset discussion
Message types
HYPE = “hype”
MAPPER_NOTE = “mapper_note”
PRAISE = “praise”
PROBLEM = “problem”
REVIEW = “review”
SUGGESTION = “suggestion”
- class osu.Mod(value)¶
Enum of all mods, score submittable or not.
Mods
Easy = ‘EZ’
NoFail = ‘NF’
HalfTime = ‘HT’
Daycore = ‘DC’
HardRock = ‘HR’
SuddenDeath = ‘SD’
Perfect = ‘PF’
DoubleTime = ‘DT’
Nightcore = ‘NC’
Hidden = ‘HD’
Flashlight = ‘FL’
Blinds = ‘BL’
StrictTracking = ‘ST’
Target = ‘TP’
DifficultyAdjust = ‘DA’
Classic = ‘CL’
Random = ‘RD’
Mirror = ‘MR’
Alternate = ‘AL’
SingleTap = ‘SG’
Autoplay = ‘AT’
Cinema = ‘CN’
Relax = ‘RX’
Autopilot = ‘AP’
SpunOut = ‘SO’
Transform = ‘TR’
Wiggle = ‘WG’
SpinIn = ‘SI’
Grow = ‘GR’
Deflate = ‘DF’
WindUp = ‘WU’
WindDown = ‘WD’
Traceable = ‘TC’
BarrelRoll = ‘BR’
ApproachDifferent = ‘AD’
Muted = ‘MU’
NoScope = ‘NS’
Magnetised = ‘MG’
Repel = ‘RP’
AdaptiveSpeed = ‘AS’
FreezeFrame = ‘FR’
TouchDevice = ‘TD’
Swap = ‘SW’
FloatingFruits = ‘FF’
FadeIn = ‘FI’
FourKeys = ‘4K’
FiveKeys = ‘5K’
SixKeys = ‘6K’
SevenKeys = ‘7K’
EightKeys = ‘8K’
NineKeys = ‘9K’
TenKeys = ‘10K’
OneKey = ‘1K’
TwoKeys = ‘2K’
ThreeKeys = ‘3K’
DualStages = ‘DS’
Invert = ‘IN’
ConstantSpeed = ‘CS’
HoldOff = ‘HO’
AccuracyChallenge = ‘AC’
- class osu.Mods(value)¶
IntFlag enum for all score submittable mods. Info gathered from https://github.com/ppy/osu-web/blob/973315aded8a5762fc00a9f245337802c27bd213/app/Libraries/Mods.php and https://github.com/ppy/osu-web/blob/973315aded8a5762fc00a9f245337802c27bd213/database/mods.json
List of mods, their acronyms, and their bitwise representation
NoFail (NF) = 1 << 0
Easy (EZ) = 1 << 1
TouchDevice (TD) = 1 << 2 # Replaces unused NoVideo mod
Hidden (HD) = 1 << 3
HardRock (HR) = 1 << 4
SuddenDeath (SD) = 1 << 5
DoubleTime (DT) = 1 << 6
Relax (RX) = 1 << 7
HalfTime (HT) = 1 << 8
Nightcore (NC) = (1 << 9)
Flashlight (FL) = 1 << 10
SpunOut (SO) = 1 << 12
AutoPilot (AP) = 1 << 13
Perfect (PF) = 1 << 14
FadeIn (FI) = 1 << 20
Mirror (MR) = 1 << 30
Key4 (4K) = 1 << 15
Key5 (5K) = 1 << 16
Key6 (6K) = 1 << 17
Key7 (7K) = 1 << 18
Key8 (8K) = 1 << 19
Key9 (9K) = 1 << 24
- classmethod get_from_abbreviation(abbreviation: str) Mods¶
Get mod from its abbreviation. Abbreviations are taken from https://osu.ppy.sh/wiki/en/Game_modifier/Summary
Parameters
- abbreviation:
str Abbreviation of the mod (must be capitalized)
Returns
- abbreviation:
- static get_from_list(mods: Sequence[Mods]) Mods | None¶
Get a
Modsobject from a list ofMods.Parameters
- mods: Sequence[
Mods] Sequence of mods of type Mods
Returns
Union[
Mods,NoneType]- mods: Sequence[
- get_incompatible_mods()¶
Get a list of mods that are incompatible with this mod.
Returns
Sequence[
Mods]
- is_compatible_combination()¶
Check if all the mods in this Mods object are compatible with each other.
Returns
bool
- is_compatible_with(other: Mods)¶
Check if this mod is compatible with another mod.
Parameters
- other:
Mods Mod to check compatibility with.
Returns
bool- other:
- static parse_any_list(mods: Sequence[str | int | Mods]) Mods¶
Take a list and return a parsed list. Parsing the list involves converting any object recognizable as a mod to a
Modsobject. This includes mod names/abbreviations as strings and also their bitset values.Parameters
- mods: Sequence[Union[
Mods,str,int]] Sequence of
Mods,str, and/orintobjects to be parsed and returned as aModsobject.
Returns
Union[
Mods,NoneType]- mods: Sequence[Union[
- to_readable_string()¶
Get a readable string representation of this mod (sorted by bitset ascending). Example: (Mods.HardRock | Mods.Hidden) -> “HDHR”
Returns
str
- class osu.NotificationCategory(value)¶
Enum for notification categories.
Notification Categories
BEATMAP_OWNER_CHANGE = ‘beatmap_owner_change’
BEATMAPSET_DISCUSSION_LOCK = ‘beatmapset_discussion’
BEATMAPSET_DISCUSSION_POST_NEW = ‘beatmapset_discussion’
BEATMAPSET_DISCUSSION_QUALIFIED_PROBLEM = ‘beatmapset_problem’
BEATMAPSET_DISCUSSION_REVIEW_NEW = ‘beatmapset_discussion’
BEATMAPSET_DISCUSSION_UNLOCK = ‘beatmapset_discussion’
BEATMAPSET_DISQUALIFY = ‘beatmapset_state’
BEATMAPSET_LOVE = ‘beatmapset_state’
BEATMAPSET_NOMINATE = ‘beatmapset_state’
BEATMAPSET_QUALIFY = ‘beatmapset_state’
BEATMAPSET_RANK = ‘beatmapset_state’
BEATMAPSET_REMOVE_FROM_LOVED = ‘beatmapset_state’
BEATMAPSET_RESET_NOMINATIONS = ‘beatmapset_state’
CHANNEL_ANNOUNCEMENT = ‘announcement’
CHANNEL_MESSAGE = ‘channel’
COMMENT_NEW = ‘comment’
FORUM_TOPIC_REPLY = ‘forum_topic_reply’
USER_ACHIEVEMENT_UNLOCK = ‘user_achievement_unlock’
USER_BEATMAPSET_NEW = ‘user_beatmapset_new’
USER_BEATMAPSET_REVIVE = ‘user_beatmapset_new’
- class osu.NotificationType(value)¶
Types of notifications that can be received.
Notification types
BEATMAP_OWNER_CHANGE = ‘beatmap_owner_change’
BEATMAPSET_DISCUSSION_LOCK = ‘beatmapset_discussion_lock’
BEATMAPSET_DISCUSSION_POST_NEW = ‘beatmapset_discussion_post_new’
BEATMAPSET_DISCUSSION_QUALIFIED_PROBLEM = ‘beatmapset_discussion_qualified_problem’
BEATMAPSET_DISCUSSION_REVIEW_NEW = ‘beatmapset_discussion_review_new’
BEATMAPSET_DISCUSSION_UNLOCK = ‘beatmapset_discussion_unlock’
BEATMAPSET_DISQUALIFY = ‘beatmapset_disqualify’
BEATMAPSET_LOVE = ‘beatmapset_love’
BEATMAPSET_NOMINATE = ‘beatmapset_nominate’
BEATMAPSET_QUALIFY = ‘beatmapset_qualify’
BEATMAPSET_RANK = ‘beatmapset_rank’
BEATMAPSET_REMOVE_FROM_LOVED = ‘beatmapset_remove_from_loved’
BEATMAPSET_RESET_NOMINATIONS = ‘beatmapset_reset_nominations’
CHANNEL_ANNOUNCEMENT = ‘channel_announcement’
CHANNEL_MESSAGE = ‘channel_message’
COMMENT_NEW = ‘comment_new’
FORUM_TOPIC_REPLY = ‘forum_topic_reply’
USER_ACHIEVEMENT_UNLOCK = ‘user_achievement_unlock’
USER_BEATMAPSET_NEW = ‘user_beatmapset_new’
USER_BEATMAPSET_REVIVE = ‘user_beatmapset_revive’
- class osu.ObjectType(value)¶
Enum for different object types. Score types are most relevant.
Object types
BeatmapDiscussion = “beatmapset_discussion”
BeatmapDiscussionPost = “beatmapset_discussion_post”
Beatmapset = “beatmapset”
Build = “build”
Channel = “channel”
Comment = “comment”
ForumPost = “forum_post”
ForumTopic = “forum_topic”
LegacyMatchScore = “legacy_match_score”
NewsPost = “news_post”
ScoreBestFruits = “score_best_fruits”
ScoreBestMania = “score_best_mania”
ScoreBestOsu = “score_best_osu”
ScoreBestTaiko = “score_best_taiko”
ScoreFruits = “score_fruits”
ScoreMania = “score_mania”
ScoreOsu = “score_osu”
ScoreTaiko = “score_taiko”
SoloScore = “solo_score”
User = “user”
- class osu.PlaylistQueueMode(value)¶
Enum for playlist queue modes.
Playlist queue modes
HOST_ONLY = ‘host_only’
- class osu.RankStatus(value)¶
IntEnum enum for rank status of a beatmap.
Statuses
GRAVEYARD = -2
WIP = -1
PENDING = 0
RANKED = 1
APPROVED = 2
QUALIFIED = 3
LOVED = 4
- class osu.RealTimeQueueMode(value)¶
Enum for realtime queue modes.
Realtime queue modes
HOST_ONLY = ‘host_only’
ALL_PLAYERS = ‘all_players’
ALL_PLAYERS_ROUND_ROBIN = ‘all_players_round_robin’
- class osu.RoomCategory(value)¶
Enum for room categories.
Room categories
NORMAL = ‘normal’
SPOTLIGHT = ‘spotlight’
FEATURED_ARTIST = ‘featured_artist’
- class osu.RoomFilterMode(value)¶
Enum for different filtering modes of rooms.
Room filter mode types
ENDED = ‘ended’
PARTICIPATED = ‘participated’
OWNED = ‘owned’
ACTIVE = ‘active’
- class osu.RoomSort(value)¶
Sort options for rooms. Relevant to
osu.Client.get_rooms().Room sort options
ENDED = ‘ended’
CREATED = ‘created’
- class osu.RoomType(value)¶
Enum for room types.
Room types
PLAYLISTS = “playlists”
HEAD_TO_HEAD = “head_to_head”
TEAM_VERSUS = “team_versus”
- class osu.ScoringType(value)¶
Scoring type used for a legacy multiplayer match
Scoring types
SCORE = “score”
ACCURACY = “accuracy”
COMBO = “combo”
SCOREV2 = “scorev2”
- class osu.TeamType(value)¶
The team type used for a legacy multiplayer match
Team types
HEAD_TO_HEAD = “head-to-head”
TAG_COOP = “tag-coop”
TEAM_VS = “team-vs”
TAG_TEAM_VS = “tag-team-vs”
- class osu.UserAccountHistoryType(value)¶
Type of account history object
User Account History Types
NOTE = “note”
RESTRICTION = “restriction”
SILENCE = “silence”
TOURNAMENT_BAN = “tournament_ban”
- class osu.UserBeatmapType(value)¶
User beatmap types. Relavent to
osu.Client.get_user_beatmaps().User beatmap types
favourite, graveyard, loved, most_played, pending, ranked
FAVOURITE = ‘favourite’
GRAVEYARD = ‘graveyard’
LOVED = ‘loved’
MOST_PLAYED = ‘most_played’
PENDING = ‘pending’
RANKED = ‘ranked’
- class osu.UserRelationType(value)¶
The type of relation to a user
Relation types
FRIEND = “friend”
BLOCK = “block”
- class osu.UserScoreAggregate(data)¶
Attributes
accuracy:
floatattempts:
intcompleted:
intpp:
floatroom_id:
inttotal_score:
intuser_id:
int- playlist_item_attempts: Optional[Dict[
str,int]] contains keys “attempts” and “id”.
- position: Optional[
int] user rank
user: Optional[
UserCompact]- playlist_item_attempts: Optional[Dict[
- class osu.UserScoreType(value)¶
Enum for the get_user_scores endpoint that specifies score type.
User score types
BEST = “best”
FIRSTS = “firsts”
RECENT = “recent”
PINNED = “pinned”
- class osu.WikiSearchMode(value)¶
Enum for wiki search modes. Relevant to
osu.Client.search().ALL = “all”
USER = “user”
WIKI = “wiki_page”