Skip to main content

GDScript and Python runtime environment

Project description


GDScript to Python to C Transpiler

Godot MIT license Python


gdscript-transpiler-bin is a GDScript compiler (using Nuitka), minimal scripts can be transpiled to Python.

Binary builds are compiled using Forgejo Actions for Alpine Linux, macOS and Windows x86_64.

Other compatible platforms: Android (aarch64 and x86_64).

Also see generated Python source from GDScript.

Video

Example

git clone https://codeberg.org/LinuxUserGD/gdscript-transpiler-bin.git

cd gdscript-transpiler-bin

git submodule update --init --remote --progress

Godot Engine command line (stage0)

  • ./godot4 -s bin/gds.gd --headless help

  • ./godot4 -s bin/gds.gd --headless run=bin/gds.gd (for running GDScript directly using x-python)

  • ./godot4 -s bin/gds.gd --headless format=bin/gds.gd (for generating Python project)

  • ./godot4 -s bin/gds.gd --headless compile=bin/gds.gd (for compiling GDScript to binary using Clang and Nuitka)

Python environment (stage1)

Installing python gds

python -m pip install gdsbin

python -m pip install git+https://codeberg.org/LinuxUserGD/gdscript-transpiler-bin.git@python
  • python -m gdsbin help

  • python -m gdsbin run=bin/gds.gd

  • python -m gdsbin format=bin/gds.gd

  • python -m gdsbin compile=bin/gds.gd

Nuitka compiled binary (stage2)

Installing gds binary (available at itch.io)

unzip gdscript-transpiler-bin.zip
cd gdscript-transpiler-bin
chmod +x gds
  • ./gds[.exe] help

  • ./gds[.exe] run=bin/gds.gd

  • ./gds[.exe] format=bin/gds.gd

  • ./gds[.exe] compile=bin/gds.gd

Benchmark

Time for running GDScript code:

func string() -> int:
	var x: String = ""
	for i in range(0, 300000):
		x += " "
	return x.length()

func add() -> int:
	var x: int = -100000000
	for i in range(0, 100000000):
		x += 1
	return x
Godot Python Nuitka
benchmark.gd 11.639s 4.678s 1.857s

License

See LICENSE and CREDITS (third-party licenses)

Download files

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

Source Distribution

gdsbin-0.1.6.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

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

gdsbin-0.1.6-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file gdsbin-0.1.6.tar.gz.

File metadata

  • Download URL: gdsbin-0.1.6.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 PyPy/7.3.20

File hashes

Hashes for gdsbin-0.1.6.tar.gz
Algorithm Hash digest
SHA256 206249f73eac59c7e9a0fc569d1f4449d6f908a7ddfd5585a0bda2238843ee96
MD5 597634c2c7bc2360fa51af80c65805c2
BLAKE2b-256 3fb5e975db6a391e03e96d98c59af1d522a9919348d062810c8c6fa379593661

See more details on using hashes here.

File details

Details for the file gdsbin-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: gdsbin-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 PyPy/7.3.20

File hashes

Hashes for gdsbin-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 855f5b3405e86ce36aa36d342f5ae18cd3e22e50e580d921b8e081ca1d62e68e
MD5 c18b311946a3c6a75760ccb9a540662b
BLAKE2b-256 355c3795896eeac999084d8bba61f176cc9e7af68d3f68f9a1f13fd2fce7ab75

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