scratchattach 2.1.9
pip install scratchattach
Released:
A Scratch API Wrapper
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- Author: TimMcCool
- Tags scratch api, scratchattach, scratch api python, scratch python, scratch for python, scratch, scratch cloud, scratch cloud variables, scratch bot
Classifiers
- Development Status
- Intended Audience
- Operating System
- Programming Language
Project description
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.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- Author: TimMcCool
- Tags scratch api, scratchattach, scratch api python, scratch python, scratch for python, scratch, scratch cloud, scratch cloud variables, scratch bot
Classifiers
- Development Status
- Intended Audience
- Operating System
- Programming Language
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
File details
Details for the file scratchattach-2.1.9.tar.gz
.
File metadata
- Download URL: scratchattach-2.1.9.tar.gz
- Upload date:
- Size: 68.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec39835d63a49888bf406955b8a55781304c379edfb669d6f80f032e5a584b0 |
|
MD5 | 85f5cd3c9db3a3278172a53b19e7c4af |
|
BLAKE2b-256 | 61a3b11556f90a60b849e08c255bec0b716969887539452e479fd3967ce97d5d |
File details
Details for the file scratchattach-2.1.9-py3-none-any.whl
.
File metadata
- Download URL: scratchattach-2.1.9-py3-none-any.whl
- Upload date:
- Size: 82.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e61173d7a97e1c5a2202cb7d722fd7bed2fdea163052a174f4e5929c9ea181 |
|
MD5 | 774c9229c22b06c97e45065a2bf0421b |
|
BLAKE2b-256 | 75f1e283f387dd73ff686684bd676cf73f6d02bacc9b87db74df5108e5107858 |