PyStage

Convert your Scratch project

Turn a Scratch 3 project into Python code that runs with PyStage.

Use the web converter

  1. Publish your Scratch project or download it as an .sb3 file.
  2. Go to convert.pystage.org and convert your project.
  3. Download the resulting zip file. It contains your new Python project, ready to run.

Open the converter

Convert on your computer

  1. Export your Scratch project on the Scratch page. You will get an .sb3 file.
  2. Use the PyStage command line converter. Yes, it is unhandy, and we will work on making it easier.

The base usage is:

python -m pystage.convert.sb3 <SB3 File> -l en -d <DIRECTORY>
OptionMeaning
-lLanguage of the generated Python “scratch blocks”. At the moment en and de are available. Without it, the language neutral core API is used.
-dThe output directory, defaults to the current directory.
-iPrint the intermediate code representation.
-sPrint the sb3 project.json.
-pPrint the Python code.
-vVerbose.
-vvDebug mode.

You need PyStage installed first, see Getting started.

What is converted

Scripts, custom blocks, variables, lists, monitors and comments of your project are converted.

What is not supported

Blocks from extensions other than Pen (for example Music or Text to Speech) are not supported. They show up as a text starting with NOT SUPPORTED in the Python code, so you can search for that text and rewrite those parts by hand.

Blocks that need a microphone (loudness) are available but do nothing.

PyStage is an alpha version, so a converted project may need some fixes. If you find a project that does not convert well, please open an issue.