scratchattach

API Image

Scratch API made easy

scratchattach is the biggest and most popular Python library for Scratch.

It allows setting cloud variables, following users, updating your profile, and
so much more!

Additionally, it provides frameworks that simplify sending data through cloud variables.

Installation

Run the following command in your computer's command prompt / shell:

Import the library in Python:

You need to have Python installed on your device.
Download Python here if you don't have it.

You should learn the basics of Python before you use scratchattach.

PyPI status PyPI download month PyPI version shields.io GitHub license Documentation Status

Features

Logging in

scratchattach allows you to login with your username / password or with your session id.

Your login is saved in a Session object. Docs

Cloud variables

Using a Session object, you can connect to a project's cloud variables and set / get cloud variables anytimes.

You can also set / get TurboWarp cloud variables and get variables without logging in. Docs

Users, projects, studios and other site features

Almost all site features of the Scratch website can be used with scratchattach.
You can get and follow users, post comments, edit und upload projects, get message counts and forum posts, and do much more. Docs

Cloud events and cloud storage

Cloud events allow reacting to cloud updates in real time. If a Scratcher sets / creates / deletes a cloud var on the given project, an event will be called. Docs

Cloud storages provide an easy way to store project data by sending it over cloud variables. Docs

Cloud requests

Cloud requests are similar to cloud events, but they also send back data to the project and automatically encode / decode and parse the received data. There's no length limit for the sent and returned data.

This allows seamless communication between Scratch and Python. Docs

Message events and Filterbot

Message events allow reacting to messages in real time. Every time you receive a message on Scratch, an event will be called. Docs

scratchattach provides a filterbot framework that can be used to automatically delete spam comments. Docs

Project JSON downloading and editing

scratchattach allows getting, parsing and editing the contents of a project, either from the Scratch website or from a file.

Saving the edited project to a file or uploading it to the Scratch website is also possible. Docs

Self-hosting TurboWarp websocket servers

scratchattach supports hosting a customizable cloud websocket server that allows non-numeric cloud values, supports IP blocking and much more - with almost no effort required.
The server can be used as cloud host for cloud projects on TurboWarp. Docs

... and more!

See the documentation for all features

Getting started

Log in with your Scratch account:

Set and get cloud variables anytime:

Follow users, love their projects and comment:

API Image

Hosting

To run your Python code 24/7, you will need to host it.

In the wiki, you can find a list of recommended hosting services that can be used for this purpose.

Community Projects

Community-made Scratch projects that use scratchattach on their backends.

Loading ...