A scratch API wrapper for Python.
Project description
scratchclient
A scratch API wrapper for python.
Based off of https://github.com/edqx/node-scratch-client, and ilcheese2's cloud code based on my own.
Installation
Go to your terminal (not your python shell) and execute this command:
pip install scratchclient
If you want cloud variables to run faster, use this command:
pip install scratchclient[fast]
Example usage
Basic usage:
from scratchclient import ScratchSession
session = ScratchSession("ceebee", "--uwu--")
# post comments
session.get_user("Paddle2See").post_comment("OwO")
# lots of other stuff
print(session.get_project(450216269).get_comments()[0].content)
print(session.get_studio(29251822).description)
Cloud connection:
from scratchclient import ScratchSession
session = ScratchSession("griffpatch", "SecurePassword7")
connection = session.create_cloud_connection(450216269)
connection.set_cloud_variable("variable name", 5000)
@connection.on("set")
def on_set(variable):
print(variable.name, variable.value)
print(connection.get_cloud_variable("other variable"))
Documentation is on the way.
All bugs should be reported to the github repository or my Scratch profile.
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
scratchclient-0.5.2.tar.gz
(9.7 kB
view details)
File details
Details for the file scratchclient-0.5.2.tar.gz.
File metadata
- Download URL: scratchclient-0.5.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/3.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990a6106320e1b79e86e0dcf6a4510e5d8704074f3dc42e3f8f7f46d46cf2542
|
|
| MD5 |
95c323fc1dc9b08c030c990f5b9c1121
|
|
| BLAKE2b-256 |
917e5eea61d8c61d1276a4647e861ec9b1fac724becea132d4b067db8977a48c
|