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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file gobomatic-2.0.1.tar.gz.

File metadata

  • Download URL: gobomatic-2.0.1.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for gobomatic-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5e9867c6d6222b20cfd94905e85344b9dc97203ad580d6eaba75fc84719a9de8
MD5 fe80613a839eabfc58373351928c6fbf
BLAKE2b-256 6074114d89c2e61d80b3ddf246f554211d58fc0ab3afbeb1683eb925709c4d66

See more details on using hashes here.

File details

Details for the file gobomatic-2.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: gobomatic-2.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for gobomatic-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c19399b2937d05431dbb5875c572e78ca51be220b4baf437bb8f97d1ad73d67
MD5 c4f05efcc1b71cd5ebc0e4af7155aa84
BLAKE2b-256 4295094b5a7d697274fcf29cc722b36797ef4308475bf3801d35c0252792af70

See more details on using hashes here.

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