scratchattach is a Scratch API wrapper with support for almost all site features. Created by TimMcCool.
The library allows setting cloud variables, following users, updating your profile, and so much more! Additionally, it provides frameworks that simplify sending data through cloud variables.
Documentation
Helpful resources
Report bugs by opening an issue on this repository. If you need help or guideance, leave a comment in the official forum topic. Projects made using scratchattach can be added to this Scratch studio.
Helpful for contributors
Contribute code by opening a pull request on this repository.
️Example usage
Set a cloud variable:
import scratchattach as sa
session = sa.login("username", "password")
cloud = session.connect_cloud("project_id")
cloud.set_var("variable", value)
Getting started
Installation:
Run the following command in your command prompt / shell:
pip install -U scratchattach
If this doesn't work, try running:
python -m pip install -U scratchattach
Logging in with username / password:
import scratchattach as sa
session = sa.login("username", "password")
login() returns a Session object that saves your login and can be used to connect objects like users, projects, clouds etc.
Logging in with a sessionId: You can get your session id from your browser's cookies. More information
import scratchattach as sa
session = sa.login_by_id("sessionId", username="username") #The username field is case sensitive
Cloud variables:
cloud = session.connect_cloud("project_id") # connect to the cloud
value = cloud.get_var("variable")
cloud.set_var("variable", "value") # the variable name is specified without the cloud emoji
Cloud events:
cloud = session.connect_cloud('project_id')
events = cloud.events()
@events.event
def on_set(activity):
print("variable", activity.var, "was set to", activity.value)
events.start()
Follow users, love their projects and comment:
user = session.connect_user('username')
user.follow()
project = user.projects()[0]
project.love()
project.post_comment('Great project!')
All scratchattach features are documented in the documentation.
Release files for scratchattach 2.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scratchattach-2.2.4.tar.gz | 128.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scratchattach-2.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 276.3 kB
Release files / scratchattach-2.2.4.tar.gz
| Download URL | scratchattach-2.2.4.tar.gz |
|---|---|
| Size | 128.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9772e43d3c01ced3a4b9ec181d452a7bfcfb1041e84745c15356f7bf9f1cef0
|
|
BLAKE2b-256 checksum How to use checksums |
4a2f6ae366f1e7f95907dcffbc4702f0cb73a757b1e1a5611b4922188ce14451
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / scratchattach-2.2.4-py3-none-any.whl
| Download URL | scratchattach-2.2.4-py3-none-any.whl |
|---|---|
| Size | 148.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fce95fefada7104c1531f37f25ce1f76e681ab507cfdfc50fa50f2bcc5c5cdb
|
|
BLAKE2b-256 checksum How to use checksums |
e154591dd98853b9491abc6c75548abaaedc066facffbc4c59437bdfa32d56ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log