- 
                Notifications
    You must be signed in to change notification settings 
- Fork 11
ScratchSession
The username of the logged in user.
Example:
session = ScratchSession("ceebee", "--uwu--")
print(session.username)
# ceebeeThe Scratch session ID of the logged in user's session.
The X-Token of the logged in user.
The CSRF token of the logged in user's session.
The User object of the logged in user.
Example:
session = ScratchSession("ceebee", "--uwu--")
print(session.user.id)
# 2755634Gets the User object of the specified username.
Example:
print(session.get_user("griffpatch").scratchteam)
# FalseGets the Project object for the specified ID.
Example:
print(session.get_project(60917032).title)
# Appel v1.4Gets the Studio object for the specified ID.
Example:
print(session.get_studio(26135902).owner)
# Za-CharyGets Scratch's news as an array of News objects.
Example:
print(session.get_news()[0].title)
# Wiki Wednesday!Gets the messages of the logged in user as an array of Message objects. If the all parameter is specified as True, all the messages are fetched. Otherwise, they are fetched with a limit of limit messages and and offset of offset. If a filter is provided, the messages are filtered with it.
Example:
print(session.get_messages(all=True)[0].actor)
# griffpatch
print(session.get_messages(limit=40, offset=10, filter="comments")[0].comment_fragment)
# thank you my friendCreates a cloud connection for the specified project ID. Returns a CloudConnection object.
Example:
connection = session.create_cloud_connection(104)
print(connection.get_cloud_variable('foo'))Explores Scratch projects with the specified mode and query. Returns an array of Project objects.
Example:
print(session.explore_projects()[0].title)
# Epic 7D platformer 2021Explores Scratch studios with the specified mode and query. Returns an array of Studio objects.
Searches Scratch projects with the specified mode and query. Returns an array of Project objects.
Searches Scratch studios with the specified mode and query. Returns an array of Studio objects.