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.1.tar.gz (6.0 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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ScratchLatch-1.1.tar.gz
Algorithm Hash digest
SHA256 8f85d749de185ffe2f72b9dc6b47aa64a682ce2bd4b83cc89c9ad2fa5b0fb0c9
MD5 2607f02843d57ac346e7026156410948
BLAKE2b-256 d1c0007f37392cd2b3823f60ca04dc764b6db3626606d34f5ad6524a93ff2053

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ScratchLatch-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac0de7ced41b79e317a99c82c4a42318e1fd8742c2011d3784e839fcb8b5ddac
MD5 49ea8eb72b82befc136bf2273fe62f98
BLAKE2b-256 abde71ec656422653ccde2cbd1872bcf78ed3d6a5fdd25caee7d072c5c8bf346

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