Skip to main content

Gobomatic is a Python library to generate Scratch (3>) projects from Object-Oriented representation of Scratch projects in Python code.

Project description

Gobomatic

Gobomatic is a Python library to generate Scratch (3>) projects from Object-Oriented representation of Scratch projects in Python code.

Example

A build.py file is used to build the Scratch project. It also defines the Stage sprite.

build.py

from gobomatic import *

from main import Self as main

stage = Sprite(
    "Stage",
    costumes = [
        "assets/blank.svg"
    ]
)

Self = Project(
    sprites = [
        stage,
        main
    ]
)

Self.export("project.sb3", debug=True)

Each sprite is defined in its own Python file.

main.py

from gobomatic import *

Self = Sprite(
    name=__name__,
    costumes = [
        "assets/scratchcat.svg"
    ]
)

Self.WhenFlagClicked(
    Goto(-100, 0),
    Glide(0, 0, 0.5),
    Say("Hello, World!"),
)

Resulting project code

e

Documentation

~/docs/docs.md

Contributing

You can help with the development of gobomatic by testing or writing documentation.

Installation from source

clone the repository (You should fork the repository first!)

cd ~/Projects
git clone https://github.com/aspizu/gobomatic gobomatic-git

install the module in edit mode

cd gobomatic-git
pip install -e .

Testing

Use ~/examples/testing to test various Scratch code.

building the project

cd examples/testing
python build.py

open testing.sb3 in the Scratch editor to examine the result.

Mentions

Thanks to @DavidBuchanan314, They too are working on a similar project but with different goals boiga which was the inspiration for this project.

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

gobomatic-2.0.1.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

gobomatic-2.0.1-py2.py3-none-any.whl (16.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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