An Scratch API Wrapper for scra tch.mit.edu
Project description
Scratch API wrapper with support for almost all site features. Created by TimMcCool.
This library can set cloud variables, follow Scratchers, post comments and do so much more! It has special features that make it easy to transmit data through cloud variables.
Links
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.
Example usage
import scratchattach as scratch3
session = scratch3.login("username", "password")
conn = session.connect_cloud("project_id")
conn.set_var("variable", value)
Getting started
Installation:
Run the following command in your command prompt / shell:
pip install -U scratchattach
Logging in with username / password:
import scratchattach as scratch3
session = scratch3.login("username", "password")
login()
returns a Session
object that saves your login.
Logging in with a sessionId: You can get your session id from your browser's cookies. More information
import scratchattach as scratch3
session = scratch3.Session("sessionId", username="username") #The username field is case sensitive
Connect to the Scratch cloud:
conn = session.connect_cloud("project_id")
Get / Set a cloud var:
value = scratch3.get_var("project_id", "variable")
conn.set_var("variable", "value") #the variable name is specified without the cloud emoji
Follow a user / love a project:
user_to_follow = session.connect_user("username")
user_to_follow.follow()
project_to_love = session.connect_project("project_id")
project_to_love.love()
All scratchattach features are documented in the documentation.
Contributors
- Allmost all code by TimMcCool.
- See the GitHub repository for full list of contributors.
- Create a pull request to contribute code yourself.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for scratchattach-1.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c723ced86e33c2fb0cc5153d6ec747fb025a019e16fc065db9d6f154cbb0a716 |
|
MD5 | d2f0dcd04b5aa50933c723d8973b61d9 |
|
BLAKE2b-256 | a1558fcc88f137913bd7b83e8d1c3354e4f79e78a073b21cd31cd6af856a41c5 |