Skip to content

scottwedge/gd.py

 
 

Repository files navigation

gd.py

Project License

Build Status

PyPI Library Version

Required Python Versions

Project Development Status

Library Downloads/Week

Documentation Status

Code Quality [Codacy]

Patreon Page [Support]

gd.py is a library that provides its users ability to interact with servers of Geometry Dash.

Key Features

  • Modern Pythonic API
  • High coverage of the supported Geometry Dash API
  • Using async and await syntax

Installing

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.

Development Version

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]

Quick example

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.

API

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

Credits

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.

Authors

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.

About

An API Wrapper for Geometry Dash written in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Rust 0.4%