gd.py is a library that provides its users ability to interact with servers of Geometry Dash.
- Modern Pythonic API
- High coverage of the supported Geometry Dash API
- Using
async
andawait
syntax
Python 3.6 or higher is required
To install the library, you can just run the following command:
# Linux/OS X
python3 -m pip install -U gd.py
# Windows
py -3 -m pip install -U gd.py
gd.py provides an optional Cython extension to speed up its parser functions in gd.api folder, so make sure that you have Cython and C++ Build Tools installed.
You can install stable version of gd.py like this:
$ python3 -m pip install gd.py[dev]
Or you can install development version from GitHub:
$ git clone https://github.com/NeKitDS/gd.py.git
$ cd gd.py
$ python3 -m pip install -U .[dev]
Below is an example of fetching a song by its ID.
import gd
client = gd.Client()
async def test():
song = await client.get_song(633206)
print(song.name)
client.run(test())
# OUTPUT: Random Song 01
You can find more examples in examples directory.
gd.py provides server with wrapper around itself, which can be started via a command:
$ python3 -m gd server
Every interaction with the server requires logged in client.
You can login into API system via its endpoint:
import requests
URL = "http://nekit.xyz/api/" # you can use this server
data = requests.get(
URL + "auth/", params={"name": "YOUR_NAME", "password": "YOUR_PASSWORD"}
).json()
token = data["token"]
print(token) # "01a2345678b9012345cd6e7fa8bc9cfab01234c56def7a89bc0de1fab234c56d", for example
Thanks to Alex1304 for inspiring the creation of this library.
Credits to Rapptz and discord.py library developers; tasks package in discord.py is a base for tasks.py file.
This project is mainly developed by NeKitDS. Big thanks to cos8o and SMJS for helping to make several requests. Also thanks to cos8o again for developing GDCrypto library, which was used as a base for crypto package.