Skip to main content

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.

PyPI status PyPI download month PyPI version shields.io GitHub license Documentation Status

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

This version

1.4.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scratchattach-1.4.4.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scratchattach-1.4.4-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file scratchattach-1.4.4.tar.gz.

File metadata

  • Download URL: scratchattach-1.4.4.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for scratchattach-1.4.4.tar.gz
Algorithm Hash digest
SHA256 9b3fa57bae7562ad6ec6e1bbb0f5d07360518f519e35bc764c322365084aad55
MD5 c2ab881d43fe2cfe8180ceb25768864b
BLAKE2b-256 9f7362c3ab55ac4bb91addd634725257b6b23a8044f98d39bd0b0c76927084cc

See more details on using hashes here.

File details

Details for the file scratchattach-1.4.4-py3-none-any.whl.

File metadata

  • Download URL: scratchattach-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for scratchattach-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 684e7f3d4049da609b5365f22a4273a374966e9c56e3700e791b621635183177
MD5 f89e1d516414c7539d0aa5f162cba29c
BLAKE2b-256 37ad3a8d882a9a7135a64b277a2d3d702a955a665924628e81620d2f506f23a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page