SandCastleIcon.png This article has links to websites or programs outside of Scratch and Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites.
SandCastleIcon.png This article documents something which is not associated with Scratch, the Lifelong Kindergarten Group, or the Massachusetts Institute of Technology.

Wikipedia-logo.svg  For more information, see Python on Wikipedia.

The Python logo- two cartoon snakes, blue and yellow
Python logo

Python is a programming language that is generally considered to be easy to learn. It was first released in 1991 by Guido van Rossum, named after the Monty Python comedy group.[1] The language is commonly learnt after Scratch.[2]

This page describes using Python with Scratch and various Scratch-related Python programs.


There are libraries that can help ease writing code that connects Python to Scratch.

Note Warning: The extension mechanisms for the different versions are quite different, and are not compatible.

Scratch 3.0

  • scratchclient — Python3 module for connecting to the Scratch API, updating and viewing cloud variables, and more.
  • scratchconnect — Python3 module for connecting to the Scratch API, view and updating cloud variables, and more.
  • scratch2py — Python3 module for connecting to the Scratch API, view and updating cloud variables, and more.
  • scratchlink — Python3 module for connecting to the Scratch API without requiring users to log in.
  • scratchattach — Python3 module with an event listener, and many different features
  • scratchcloud — Python3 module for viewing and editing cloud variables.

Scratch 2.0

  • blockext — for writing extensions that are compatible with both Scratch 2.0 and Snap!. Generates extension files automatically. Clean programming interface. Needs documentation.
  • ScratchAPI — Open source Python library providing an interface for the Scratch APIs.

Scratch 1.4

See the guide for setting up Remote Sensor Connections in Scratch 1.4.

  • Scratra — Provides a clean interface for responding to broadcasts and sensor updates using decorators (based on
  • (forum page) by pquiza — provides code for communicating with Scratch
  • Scratch Space by Magnie — a Mesh server

Projects that interact with Scratch using Python and remote sensor connections:

  • by TheSuccessor — allows usage of Scratch as a web server


Scratch-related software written in Python:

  • M30W, previously Emerald — a text version of Scratch[3]

Scratch-related libraries that can be used in Python code:


See also: Scratch 2.0

The Scratch 2.0 website used Python as its back-end, or server-side code, as do pages on the Scratch 3.0 website that have not yet been modernized to 3.0. This means that pages on the site (such as profile pages) are produced by Python code. Django, a Python library for creating large database-driven websites, is the main library used.


External Links