Models¶
Data models representing Geometry Dash entities.
User¶
gdpy.models.user.User ¶
Bases: BaseModel
Represents a Geometry Dash user profile.
Contains all information about a user including stats, icons, social links, and moderation status.
Attributes:
| Name | Type | Description |
|---|---|---|
username | str | The user's display name. |
user_id | int | The user's ID (different from account ID). |
account_id | int | The user's account ID. |
stars | int | Total stars collected. |
diamonds | int | Total diamonds collected. |
moons | int | Total moons collected. |
secret_coins | int | Secret coins collected (max 3). |
user_coins | int | User coins collected. |
demons | int | Demons completed. |
creator_points | int | Creator points earned. |
icon_id | int | Current icon ID. |
color1 | int | Primary icon color. |
color2 | int | Secondary icon color. |
color3 | int | None | Glow color (if has_glow is True). |
icon_type | int | Current icon type (cube, ship, ball, etc.). |
has_glow | bool | Whether glow is enabled. |
youtube | str | None | YouTube channel (if set). |
twitter | str | None | Twitter handle (if set). |
twitch | str | None | Twitch channel (if set). |
discord | str | None | Discord handle (if set). |
instagram | str | None | Instagram username (if set). |
tiktok | str | None | TikTok handle (if set). |
mod_level | ModLevel | Moderator status. |
message_state | MessageState | Message privacy setting. |
friend_state | int | Friend request setting. |
comment_history_state | int | Comment history visibility. |
global_rank | int | None | Global leaderboard rank (if on leaderboard). |
Example
parse_bool classmethod ¶
Parse boolean values from string responses.
Source code in gdpy/models/user.py
Level¶
gdpy.models.user.Level ¶
Bases: BaseModel
Represents a Geometry Dash level.
Contains all information about a level including stats, difficulty, and audio information.
Attributes:
| Name | Type | Description |
|---|---|---|
level_id | int | Unique level identifier. |
name | str | Level name. |
description | str | Level description. |
version | int | Level version number. |
author_id | int | Creator's player ID. |
downloads | int | Total downloads. |
likes | int | Total likes. |
stars | int | Star rating (0 if not rated). |
difficulty | LevelDifficulty | Level difficulty (includes AUTO and demon difficulties). |
featured | bool | Whether level is featured. |
objects | int | Object count in level. |
length | LevelLength | Level length classification. |
song_id | int | None | Custom song ID (if using custom song). |
official_song_id | int | None | Official song ID (if using official song). |
coins | int | Number of user coins in level. |
verified_coins | bool | Whether coins are verified. |
two_player | bool | Whether level supports two players. |
level_string | str | None | Level data (only in downloads). |
epic_rating | EpicRating | Epic/legendary/mythic rating. |
password | str | None | Level password (if copyable). |
Example:
compute_difficulty classmethod ¶
Compute difficulty from raw API fields.
Uses: - Key 9: difficulty_numerator (0=auto/unrated, 10=easy, 20=normal, 30=hard, 40=harder, 50=insane) - Key 17: is_demon - Key 25: is_auto - Key 43: demon_difficulty (3=easy, 4=medium, 0=hard, 5=insane, 6=extreme)
Source code in gdpy/models/user.py
decode_description classmethod ¶
Decode base64 encoded level description.
Source code in gdpy/models/user.py
decode_level_string classmethod ¶
Decode base64 and decompress level string.
Source code in gdpy/models/user.py
parse_bool classmethod ¶
Parse boolean values from string responses.
Source code in gdpy/models/user.py
Comment¶
gdpy.models.user.Comment ¶
Bases: BaseModel
Represents a level or profile comment.
Attributes:
| Name | Type | Description |
|---|---|---|
content | str | Comment text content. |
author | str | Comment author's username. |
author_id | int | Comment author's user ID. |
likes | int | Number of likes on the comment. |
message_id | int | Unique comment/message ID. |
percent | int | Progress percentage shown in comment. |
age | str | How long ago the comment was posted. |
is_spam | bool | Whether comment is marked as spam. |
decode_base64 classmethod ¶
Decode base64 encoded comment content.
Source code in gdpy/models/user.py
Song¶
gdpy.models.user.Song ¶
Bases: BaseModel
Represents a custom song from Newgrounds.
Attributes:
| Name | Type | Description |
|---|---|---|
song_id | int | Unique song identifier. |
name | str | Song name. |
author | str | Song artist name. |
size | float | File size in MB. |
download_url | str | URL to download the song. |
Message¶
gdpy.models.user.Message ¶
Bases: BaseModel
Represents a private message.
Attributes:
| Name | Type | Description |
|---|---|---|
message_id | int | Unique message identifier. |
subject | str | Message subject. |
sender_id | int | Sender's account ID. |
sender_name | str | Sender's username. |
age | str | How long ago the message was sent. |
is_read | bool | Whether the message has been read. |
content | str | None | Message content (only when downloading). |
decode_base64 classmethod ¶
Decode base64 encoded message content.
Source code in gdpy/models/user.py
FriendRequest¶
gdpy.models.user.FriendRequest ¶
Bases: BaseModel
Represents a friend request.
Attributes:
| Name | Type | Description |
|---|---|---|
request_id | int | Unique request identifier. |
sender_id | int | Sender's account ID. |
sender_name | str | Sender's username. |
age | str | How long ago the request was sent. |
is_read | bool | Whether the request has been read. |
LeaderboardScore¶
gdpy.models.user.LeaderboardScore ¶
Bases: BaseModel
Represents a leaderboard entry.
Attributes:
| Name | Type | Description |
|---|---|---|
username | str | Player's username. |
user_id | int | Player's user ID. |
stars | int | Total stars. |
demons | int | Demons completed. |
ranking | int | Global rank position. |
creator_points | int | Creator points earned. |
icon_id | int | Current icon ID. |
color1 | int | Primary icon color. |
color2 | int | Secondary icon color. |
secret_coins | int | Secret coins collected (max 3). |
icon_type | int | Current icon type. |
account_id | int | Player's account ID. |
user_coins | int | User coins collected. |
diamonds | int | Total diamonds. |
Enums¶
ModLevel¶
gdpy.models.user.ModLevel ¶
Bases: IntEnum
Moderator level for a user.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE | Not a moderator. | |
MODERATOR | Regular moderator (yellow badge). | |
ELDER_MOD | Elder moderator (orange badge). |
MessageState¶
gdpy.models.user.MessageState ¶
Bases: IntEnum
Message privacy settings.
Attributes:
| Name | Type | Description |
|---|---|---|
ALL | Anyone can send messages. | |
FRIENDS_ONLY | Only friends can send messages. | |
NONE | No one can send messages. |
LevelDifficulty¶
gdpy.models.user.LevelDifficulty ¶
Bases: IntEnum
Level difficulty rating.
Attributes:
| Name | Type | Description |
|---|---|---|
UNSPECIFIED | No difficulty specified. | |
AUTO | Auto level (no skill required). | |
EASY | Easy difficulty. | |
NORMAL | Normal difficulty. | |
HARD | Hard difficulty. | |
HARDER | Harder difficulty. | |
INSANE | Insane difficulty. | |
EASY_DEMON | Easy demon. | |
MEDIUM_DEMON | Medium demon. | |
HARD_DEMON | Hard demon (default demon). | |
INSANE_DEMON | Insane demon. | |
EXTREME_DEMON | Extreme demon. |
LevelLength¶
gdpy.models.user.LevelLength ¶
Bases: IntEnum
Level length classification.
Attributes:
| Name | Type | Description |
|---|---|---|
TINY | Very short level. | |
SHORT | Short level. | |
MEDIUM | Medium length level. | |
LONG | Long level. | |
XL | Extra long level. |
handlers: python: docstring_style: google
EpicRating¶
gdpy.models.user.EpicRating ¶
Bases: IntEnum
Level epic/featured rating.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE | Not epic rated. | |
EPIC | Epic rating. | |
LEGENDARY | Legendary rating. | |
MYTHIC | Mythic rating. |
handlers: python: docstring_style: google