Skip to main content

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.

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

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)

More examples

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.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scratchattach 2.2.7
File Size Uploaded Provenance Actions
scratchattach-2.2.7.tar.gz 128.9 kB With provenance Details for scratchattach-2.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scratchattach 2.2.7
File Interpreter ABI Platform Actions
scratchattach-2.2.7-py3-none-any.whl Python 3 none any Details for scratchattach-2.2.7-py3-none-any.whl

Total release size: 278.1 kB

Release files / scratchattach-2.2.7.tar.gz

Download URL scratchattach-2.2.7.tar.gz
Size 128.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f68971edb19898df29187bf1cd6ed304d58a2b1a72ccebe3a844987ecb6dd767
BLAKE2b-256 checksum
How to use checksums
e17a1a8641834cbd2268bd6f6f1998e69191192e6513ebb411568de4f7badd02
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 Nov 5, 2026.

Transparency log

Release files / scratchattach-2.2.7-py3-none-any.whl

Download URL scratchattach-2.2.7-py3-none-any.whl
Size 149.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebe05d71565209cff09421c8fa79e61157a42ff3e2e99c0116f8a3577c0e131f
BLAKE2b-256 checksum
How to use checksums
8ce6e3401ab66830847d326717de913b96423022c2fae1455f8c87d7ae180b98
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 Nov 5, 2026.

Transparency log

Security for scratchattach 2.2.7

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scratchattach-2.2.7.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 Nov 5, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

2.2.7 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page