Convert your Scratch project
Turn a Scratch 3 project into Python code that runs with PyStage.
Use the web converter
- Publish your Scratch project or download it as an .sb3 file.
- Go to convert.pystage.org and convert your project.
- Download the resulting zip file. It contains your new Python project, ready to run.
Convert on your computer
- Export your Scratch project on the Scratch page. You will get an .sb3 file.
- 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>
| Option | Meaning |
|---|---|
-l | Language of the generated Python “scratch blocks”. At the moment en, de and lt are available. Without it, the language neutral core API is used. |
-d | The output directory, defaults to the current directory. |
-i | Print the intermediate code representation. |
-s | Print the sb3 project.json. |
-p | Print the Python code. |
-v | Verbose. |
-vv | Debug 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.