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.
Metadata
Release files for scratchattach 2.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scratchattach-2.2.6.tar.gz | 128.1 kB | With provenance | Details for scratchattach-2.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scratchattach-2.2.6-py3-none-any.whl | Python 3 | none | any | Details for scratchattach-2.2.6-py3-none-any.whl |
Total release size: 276.6 kB
Release files / scratchattach-2.2.6.tar.gz
| Download URL | scratchattach-2.2.6.tar.gz |
|---|---|
| Size | 128.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ad1e95c1938d1ec388cee613bf129208a52b77d7331978cce021596593d177c
|
|
BLAKE2b-256 checksum How to use checksums |
fd91981616bbd80dd543528d5ff91f4f32bd8ac3c25641c134f2463d0c2af239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 20, 2026.
Transparency logRelease files / scratchattach-2.2.6-py3-none-any.whl
| Download URL | scratchattach-2.2.6-py3-none-any.whl |
|---|---|
| Size | 148.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a171c8ceb4bf9ecdc9452ea6b1902c00da5016bcd386a25923d532316c08d3a8
|
|
BLAKE2b-256 checksum How to use checksums |
f9285074e4a4b32acccda8e50ae82e49280f77294a234b6ca140c997e327ea92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 20, 2026.
Transparency logSecurity for scratchattach 2.2.6
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for scratchattach-2.2.6.tar.gz
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 Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.