Skip to main content

A library that makes sending requests to the Geometry Dash servers and reading the responses easier.

Project description

dashlib

A Python library that makes sending requests to the Geometry Dash servers and reading the responses easier. Special thanks to WylieMaster and everybody else contributed to the GDDocs as it was the only source of information for the endpoints.
Library Documentation

Implemented features

  • Level downloading.\
  • Level uploading. \
  • Level searching. \
  • GDLevel class (because the kind of level objects the server returns are unreadable)
  • User info fetching (using account ID).\
  • User class GDUser
  • Commenting\
  • Posting\
  • Deleting comments\
  • Deleting posts\
  • User comment history fetching\
  • User post fetching\
  • Level comment fetching\
  • Liking/disliking\

Features to implement

  • Getting users by Player ID\
  • Leaderboard fetching\
  • Level Leaderboard fetching\
  • Icon image generation\
  • Icon kit object

How to use

Installing

Use the following command to install this library-

python -m pip install dashlib

Level Downloading

Use the downloadLevel() function to download levels. Example code-

from dashlib import *
retray=downloadLevel(6508283) #1.5 seconds
print(retray.levelName) #ReTraY
print(retray.levelID) #6508283
print(retray.password) #1532211
print(retray.stars) #2

Alternatively, use fetchLevel() or fetchLevels as these are faster, but the level string (the data for the level),password,upload and update date, and the low detail mode status is not available.

from dashlib import *
retray=fetchLevel(6508283) #0.5 seconds
some_levels=fetchLevels([128,6508283,4454123]) #still 0.5s as this is in a single request.
print(retray.levelName) #ReTraY
print(some_levels[0].levelName,some_levels[1].levelName,some_levels[2].levelName) #1st level, ReTraY, Sonar

Level Searching

Use the searchForLevels() function to search for levels. Example code-

res=searchForLevels(type=TYPE_SEARCH,page=0,query="bloodbath",difficultyFilter=FILTER_DEMON,demonFilter=DEMONFILTER_EXTREME)
print(res[0].levelName) #Bloodbath
print(res[0].levelID) #res[0].levelID

Parameters


type: Use TYPE_SEARCH,TYPE_MOSTDOWNLOAD,TYPE_MOSTLIKE,etc constants to set the type of the search,
page: The page number.
query: For TYPE_SEARCH, this is the search query,
For TYPE_USERSLEVELS, this is the user ID of the user's levels to search,
For TYPE_LISTOFID, this is a comma seperated list of level IDs
difficultyFilter: Use FILTER_NA and FILTER_EASY to FILTER_DEMON or None(default) to filter the difficulty
demonFilter: If difficultyFilter is FILTER_DEMON, then use DEMONFILTER_EASY,DEMONFILTER_MEDIUM,...,DEMONFILTER_EXTREME to filter which kind of demon to search, or use None(default).
length: Use LENGTH_TINY to LENGTH_XL and LENGTH_PLAT to filter by level length, or use None (default).
uncompleted,completed,featured,original,twoPlayer,coins,epic,legendary,mythic,noStar,star:
If any of these are True, filters by levels that have the respective property. If False, does not apply that filter.
(so if completed=False it will show BOTH the levels that are completed and those that are not.)
completedLevelIDs: If using uncompleted or completed=True, this list specifies which level IDs are completed. Otherwise, it does not matter.
followedUsers: If type=TYPE_FOLLOWED, this is a list of user IDs that are followed.\

User info fetching

You can get user info using the getUserInfo() function. Example-\

from dashlib import *
user=getUserInfo(14134) #AeonAir's account ID.
print(user.username) #AeonAir
print(user.diamonds) #45396 (however many diamonds he has)
print(user.secretCoins) #164
print(user.stars) #40840
print(user.moons) #456

Credits and resources

Special thanks to the people who maintain and have contributed to the GDDocs. This was pretty much the only source of information.
Also thanks to Colon for making GDBrowser. I did not want to open geometry dash every time I wanted to check something. (and it also would have lagged my potato laptop)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dashlib-0.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

dashlib-0.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file dashlib-0.2.tar.gz.

File metadata

  • Download URL: dashlib-0.2.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for dashlib-0.2.tar.gz
Algorithm Hash digest
SHA256 59ff932de5c9d308cdea0f5061dc2e54fd5049deae7067353bafc5b5d5634e50
MD5 01dd64acd289a40c417e1f8110c69726
BLAKE2b-256 c7e170fc9fd9adbd445fe0a91c966c329979296d7a7efc5aeb7c5d766faf9949

See more details on using hashes here.

File details

Details for the file dashlib-0.2-py3-none-any.whl.

File metadata

  • Download URL: dashlib-0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for dashlib-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 79416f46f1760b6ac466234c4b204ac4f673bf9f4bf8ad0ed17581676b357ecc
MD5 c6ad2cc71f7ef51f0c04afa0b3dd4537
BLAKE2b-256 bc600cfd45e47bcf25323ff80e9a4bf1b0dbabf0e9d15550f942113950cf8d6b

See more details on using hashes here.

Supported by

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