Save API¶
gd.py implements an interface to interact with saves of Geometry Dash.
Save¶
Warning
It is recommended to do a backup before working with saves.
Main save/load functionality is contained in SaveUtils,
exported and intended to be used as gd.api.save instance.
Example of loading a local database:
import gd
database = gd.api.save.load()
Database¶
Database is python interface to saves of Geometry Dash.
Example of working with it:
db = gd.api.create_db()
print(db.load_my_levels())
# LevelCollection[<LevelAPI id=... version=... name=...>, ...]
levels = db.levels
# <Part len=...>
print(levels.get("LLM_02", 0))
# {"LLM_01": {...}, "LLM_02": ..., ...}
-
class
gd.api.Database(main: Optional[Union[bytes, str]] = None, levels: Optional[Union[bytes, str]] = None)[source]¶ -
-
property
user_name¶ Player name.
-
property
password¶ Player password.
-
property
account_id¶ Player Account ID, same as
account_idof users.
-
property
user_id¶ Player User ID, same as
idof users.
-
property
udid¶ Player UDID.
-
property
bootups¶ Count of game bootups.
-
property
followed¶ List of followed users.
-
property
values¶ LevelValuesthat represent completed levels.
-
load_saved_levels() → gd.api.database.LevelCollection[source]¶ Load saved levels into
LevelCollection.
-
get_saved_levels() → gd.api.database.LevelCollection¶ Load saved levels into
LevelCollection.
-
dump_saved_levels(levels: gd.api.database.LevelCollection) → None[source]¶ Dump saved levels from
LevelCollection.
-
set_saved_levels(levels: gd.api.database.LevelCollection) → None¶ Dump saved levels from
LevelCollection.
-
property
saved_levels¶ Load saved levels into
LevelCollection.
-
load_created_levels() → gd.api.database.LevelCollection[source]¶ Load created levels into
LevelCollection.
-
get_created_levels() → gd.api.database.LevelCollection¶ Load created levels into
LevelCollection.
-
dump_created_levels(levels: gd.api.database.LevelCollection) → None[source]¶ Dump created levels from
LevelCollection.
-
set_created_levels(levels: gd.api.database.LevelCollection) → None¶ Dump created levels from
LevelCollection.
-
property
created_levels¶ Load created levels into
LevelCollection.
-
classmethod
load(main: Optional[Union[str, pathlib.Path]] = None, levels: Optional[Union[str, pathlib.Path]] = None, main_file: Union[str, pathlib.Path] = 'CCGameManager.dat', levels_file: Union[str, pathlib.Path] = 'CCLocalLevels.dat') → gd.api.database.Database[source]¶ Load the database. See
load()for more.
-
dump(main: Optional[Union[str, pathlib.Path]] = None, levels: Optional[Union[str, pathlib.Path]] = None, main_file: Union[str, pathlib.Path] = 'CCGameManager.dat', levels_file: Union[str, pathlib.Path] = 'CCLocalLevels.dat') → None[source]¶ Dump the database back. See
dump()for more.
-
property