An Scratch API Wrapper for scratch.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
Contributors
- Allmost all code by TimMcCool.
- See the GitHub repository for full list of contributors.
- Create a pull request to contribute code yourself.
Support
If you need help with your code, leave a comment in the official forum topic on TimMcCool's Scratch profile or open an issue on the github repo
Installation
Run the following command in your command prompt / shell:
pip install -U scratchattach
OR
Add this to your Python code:
import os
os.system("pip install -U scratchattach")
Logging in scratch3.Session
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
All scratchattach features are documented in the documentation.
Cloud variables scratch3.CloudConnection
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
All scratchattach features are documented in the documentation.
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.5.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc92ee7a59036837f67fe1da337719081f2fa1a85c579d8fbcfd01919683543f |
|
MD5 | 41863b0ba8e2d8f94c114d233b653c68 |
|
BLAKE2b-256 | 7fa201822eee1e45b9d262ae47f7d4baf1a11e34417c7ec57e3fc9490a11c5ba |