ScratchData LogoScratchData
Back to TimMcCool's profile

⚙️ scratchattach 2.0 ⚙️ Scratch API Wrapper for Python

TITimMcCool•Created June 12, 2020
⚙️ scratchattach 2.0 ⚙️ Scratch API Wrapper for Python
2279
1994
59212 views
View on Scratch

Instructions

Warning: Requires knowledge in Python (text-based coding language) scratchattach is a Scratch API wrapper with support for almost all site features. The Python library allows setting cloud variables, following users, updating your profile, and so much more! To install it, run "pip install scratchattach" in your command prompt (you need to install Python first). For more information, check out these links: ➥ Website: https://scratchattach.tim1de.net/ ➥ Documentation: https://github.com/TimMcCool/scratchattach/wiki/Documentation ➥ New features in 2.0: https://github.com/TimMcCool/scratchattach/blob/main/CHANGELOG.md Community resources: ➥ Official forum topic: https://scratch.mit.edu/discuss/topic/603418/ ➥ Studio for scratchattach projects: https://scratch.mit.edu/studios/31478892/ Example code: > import scratchattach as sa > session = sa.login("username", "password") > cloud = session.connect_cloud('project_id') > cloud.set_var('variable', 'value') > session.connect_user("user").studios()[0].post_comment("Hi").reply("hello") ⚙️ Reasons to use scratchattach⚙️ ➥ Simple to use ➥ Fast and safe ➥ Cloud events & built-in class for encoded cloud requests, also cloud storages ➥ Users, projects, comments, search, explore & more! ➥ Forum posts and topics ➥ Most features don't require a session ➥ Allows editing project JSON and hosting TurboWarp cloud servers ➥ Open-source ⚙️ Features ⚙️ - Get and set cloud variables anytime v2.0: Added method for setting multiple cloud variables simultaneously, implemented adaptive ratelimit handling and a cloud recorder - Interact with users, projects, studios and use other site features (post comments, follow users etc.) v2.0: Added getting users by id, enforced and added object representation for Projects, Studios, Comments and Activity (messages and activites) - Cloud events (improved in v2.0) - Cloud requests (packet loss fixed entirely in v2.0, massively lowered CPU usage, added new features) Similar to cloud events, but they also send back data to the project. This allows seamless communication between Scratch and Python - Cloud storages (new in v2.0) - Message events (new in v2.0) - Project JSON editing capabilities (new in v2.0) - Self-hosting TurboWarp websocket servers (new in v2.0) For all features, check the documentation: https://github.com/TimMcCool/scratchattach/wiki/Documentation For all *new* features in v2.0, check the change log: https://github.com/TimMcCool/scratchattach/blob/main/CHANGELOG.md ⚙️ What makes scratchattach special? ⚙️ -- Site features -- - it is the only library that allows getting a user by ID - it allows fetching data without logging in (methods getting objects without connecting a login start with "scratchattach.get_" while methods connecting a login start with "Session.connect_" -- Cloud features -- - it is the only library that allows setting multiple cloud variables simultaneously - it is the only library that automatically enforces intelligent rate limits between cloud variable sets to make sure you can set variables very fast and still don't get ratelimited - it provides a Cloud Requests framework that allows seamless communication between Scratch projects and Python code through cloud variables - it provides a Cloud Storage framework that makes it easy to store project data (highscores etc.) on a backend server - it is the only library with a built-in cloud recorder that allows getting a cloud variable anytime without having to query the clouddata logs -- Other features -- - it is the only library that allows editing the contents of a project with pre-built methods and directly uploading it to Scratch - it is the only library that allows self-hosting TurboWarp cloud variable servers easily - it is the only library that supports getting and editing forum topics and posts -- Structure -- - it's object-oriented, abstract and structured, this makes it possible to write code like `sa.login("username, "pw").connect_user("user").studios()[0].post_commen("Hi")` - it is the only library that uses objects to represent modals like messages, activities -- Developers -- - it has an active developer community that fixes potential bugs fast - it is constantly being extended with new features ⚙️ Installation⚙️ Run the following command in your computer's command prompt / shell: python -m pip install scratchattach Import the library in Python: import scratchattach as sa You need to have Python installed on your device. Download Python if you don't have it. You should learn the basics of Python before you use scratchattach.

Project Details

Project ID404369790
CreatedJune 12, 2020
Last ModifiedApril 26, 2025
SharedOctober 21, 2024
Visibilityvisible
CommentsAllowed