Skip to main content

Scratch's most simple Python Library!

Project description

ScratchLatch

Scratch and Python bridge


import

[Required on top of Python File]

from ScratchLatch import ScratchLatch


usersession

[creates a scratch session logging into any desired account]

username = "YOUR USERNAME HERE" # Enter your username in the quotes
password = "YOUR PASSWORD HERE" # Enter your password in the quotes
session = ScratchLatch(username, password) # Stores the session in 'session' variable


project data

[fetches data from desired project]

ID = "PROJECT ID HERE"
project = session.project(ID)


statistics

data = project.stats()['loves\favorites\views\remixes'] # Stores desired project data in the 'data' variable


assets

data = project.stats('images\sounds') # Stores desired project's images\sounds in the 'data' variable


info

data = project.getInfo()['id\title\description\instructions\public'] # Stores desired project info in the 'data' variable


project interaction

[interactis with desired project]

ID = "PROJECT ID HERE"
projectInteraction = session.projectSession(ID)


share

projectInteraction.share() # Shares desired project


unshare

projectInteraction.unshare() # un-Shares desired project


love

projectInteraction.love() # Loves desired project


favorite

projectInteraction.share() # Favorites desired project


unlove

projectInteraction.unlove() # un-Loves desired project


unfavorite

projectInteraction.unfavorite() # un-Favorites desired project


remix

projectInteraction.remix() # Remixes desired project


user data

[fetches data from desired user]

USERNAME = "USERNAME HERE"
user = session.user(USERNAME)


exists

user.exists() # Checks if user exists

get messages

user.getMessages() # Fetches user messages

message count

user.messageCount() # Fetches message count

status

user.getStatus() # Checks if user exists

bio

user.getBio() # Checks if user exists

projects

user.projects() # Fetches user projects


user interaction

[interacts with desired user]

USER = "USERNAME HERE"
userInteraction = session.userSession(USER)


follow

userInteraction.follow() # Follows desired user


unfollow

userInteraction.unfollow() # un-Follows desired user


toggleComments

userInteraction.toggleCommenting() # Follows desired user


post comment

userInteraction.postComment() # Follows desired user


studio interaction

[interacts with desired studio]

ID = "STUDIO ID HERE"
studioInteraction = session.studioSession(ID)


invite user

inviteUsername = "USER TO ADD"
studioInteraction.invite(inviteUsername) # Invites desired user to studio


add project

projectID = "PROJECT TO ADD"
studioInteraction.addProject(projectID) # Adds desired project to studio


post comment

comment = "THIS IS A COMMENT SENT FROM PYTHON!"
studioInteraction.postComment(comment) # Posts comment to desired studio


get comments

limit = 10
studioInteraction.getComments(limit=limit) # Gets last 10 comments posted in desired studio


follow

studioInteraction.follow() # Follows desired studio


unfollow

studioInteraction.unfollow() # un-Follows desired studio


Cloud Variables

ID = "PROJECT ID HERE"
cloud = session.cloud()


Scratch

scratchCloud = cloud.scratch(ID)


set variable

scratchCloud.setVar("VARIABLE NAME", "VARIABLE VALUE")


get variable

scratchCloud.getVar("VARIABLE NAME")


Turbowarp

turbowarpCloud = cloud.turbowarp(ID)


set variable

turbowarpCloud.setVar("VARIABLE NAME", "VARIABLE VALUE")


get variable

turbowarpCloud.getVar("VARIABLE NAME")


Project details


Download files

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

Source Distribution

ScratchLatch-1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

ScratchLatch-1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file ScratchLatch-1.tar.gz.

File metadata

  • Download URL: ScratchLatch-1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for ScratchLatch-1.tar.gz
Algorithm Hash digest
SHA256 b0d185a8168ca1493274fe1d35e39777f6f0f8514f72fefaf057a24f6c04119a
MD5 f6d560be9b7298c6a3a463bbd62cc86b
BLAKE2b-256 bc33aeb04606f8aa8d4df640e55282cf688993748626529dfa82ab874ee57658

See more details on using hashes here.

File details

Details for the file ScratchLatch-1-py3-none-any.whl.

File metadata

  • Download URL: ScratchLatch-1-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for ScratchLatch-1-py3-none-any.whl
Algorithm Hash digest
SHA256 892b0c5f266f05901a6e0a64cf8ee2b94e3d87e4aaf220df2d574b22f71f3a61
MD5 b3344d2c631c3a86d72073585a51ea3a
BLAKE2b-256 4b7797ec4e7316d3c61f4a862b39dd85de9f80c5c0cb8864c79d3634aeb74847

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