Package: scratchlink
ScratchLink v1.0.1IntroductionScratchLink is a simple Python Library to get the data of Scratch using the Scratch API. This library is simple to use.
This library need no login!InstallationTo use this library you must need to install the Python Programming Language. If you have already installed Python then
type the following in the Terminal (Command Prompt):pipinstallscratchlinkImportTo import scratchlink, use the following code:importscratchlink# Import Libraryscratch=scratchlink.ScratchLink()# Create an object of the ScratchLink classGetting The DataFront Page DataTo get the front page data of Scratch Website, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()front_page=scratch.link_frontpage()# Connect the front pagefront_page.health()# Get the health of the websitefront_page.news()# Get the news of the websitefront_page.front_page_projects()# Get the front page projects of the websitefront_page.explore_projects(mode="trending",query="*")# Explore the projectsfront_page.explore_studios(mode="trending",query="*")# Explore the studiosfront_page.search_projects(mode="trending",search="*")# Search the projectsfront_page.search_studios(mode="trending",search="*")# Search the studiosUser DataTo get the user data, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()user=scratch.link_user(username="Sid72020123")# Connect a Scratch Useruser.id()# Returns the ID of the useruser.thumbnail_url()# Returns the thumbnail URL of a useruser.messages_count()# Returns the messages count of the useruser.work()# Returns the 'What I am working on' of a Scratch profileuser.bio()# Returns the 'About me' of a Scratch profileuser.status()# Returns the status(Scratcher or New Scratcher) of a Scratch profileuser.joined_date()# Returns the joined date of a Scratch profileuser.country()# Returns the country of a Scratch profileuser.featured_data()# Returns the featured project data of the Scratch profileuser.projects()# Returns the list of shared projects of a useruser.followers_count()# Returns the follower count of a useruser.following_count()# Returns the following count of a useruser.total_views_count()# Returns the total views count of all the shared projects of a useruser.total_loves_count()# Returns the total loves count of all the shared projects of a useruser.total_favourites_count()# Returns the total favourites count of all the shared projects of a useruser.following()# Returns the list of the user followinguser.followers()# Returns the list of the user followersuser.favourites()# Returns the list of the user favouritesuser.user_follower_history()# Return the follower history of the useruser.all_data()# Returns all the data of the useruser.comments(limit=5,page=1)# Get comments of the profile of the useruser.pretty_print_user_data()# Pretty print the user data########################################################################### IMPORTANT NOTE: To always get the updated data use the update_data() function##########################################################################user.update_data()# Update the dataStudio DataTo get the studio data, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()studio=scratch.link_studio(studio_id=1)# Connect a Scratch Studiostudio.id()# Returns the studio IDstudio.title()# Returns the studio titlestudio.host_id()# Returns the studio owner/host IDstudio.description()# Returns the studio descriptionstudio.visibility()# Returns the studio visibilitystudio.is_public()# Returns whether a studio is publicstudio.is_open_to_all()# Returns whether a studio is open to allstudio.are_comments_allowed()# Returns whether a studio has comments allowedstudio.history()# Returns the history of the studiostudio.stats()# Returns the stats of the studiostudio.thumbnail_url()# Returns the thumbnail URL of the studiostudio.projects(all=False,limit=40,offset=0)# Get the projects of the studiostudio.comments(all=False,limit=40,offset=0)# Get the comments of the studiostudio.curators(all=False,limit=40,offset=0)# Get the curators of the studiostudio.managers(all=False,limit=40,offset=0)# Get the managers of the studiostudio.activity(all=False,limit=40,offset=0)# Get the activity of the studiostudio.pretty_print_studio_data()# Pretty print the Studio Data########################################################################### IMPORTANT NOTE: To always get the updated data use the update_data() function##########################################################################studio.update_data()# Update the dataProject DataTo get the project data, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()project=scratch.link_project(project_id=1)# Connect a Scratch Projectproject.author()# Returns the author of the projectproject.title()# Returns the title of the projectproject.notes()# Returns the notes(Notes or Credits) of the projectproject.instruction()# Returns the instructions of the projectproject.are_comments_allowed()# Returns whether the comments are allowed in a projectproject.stats()# Returns the stats of a projectproject.history()# Returns the history of a projectproject.remix_data()# Returns the remix data of a projectproject.visibility()# Returns whether the project is visibleproject.is_public()# Returns whether the project is publicproject.is_published()# Returns whether the project is publishedproject.thumbnail_url()# Returns the thumbnail url of a projectproject.assets_info()# Returns the Assets info of a projectproject.scripts()# Returns the scripts of a projectproject.comments(all=False,limit=40,offset=0,comment_id=None)# Returns the list of comments of a projectproject.remixes(all=False,limit=20,offset=0)# Returns the list of remixes of a projectproject.pretty_print_project_data()# Pretty print the project data########################################################################### IMPORTANT NOTE: To always get the updated data use the update_data() function##########################################################################project.update_data()# Update the dataCloud DataTo get the cloud data of a project, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()project=scratch.link_project(project_id=1)# Connect a Scratch Projectcloud=project.link_cloud()# Connect the Cloud Variables of a projectcloud.get_variable_data(limit=100,offset=0)# Get the variable datacloud.get_cloud_variable_value(variable_name="Name",limit=100)# Get the variable value. This will return a list containing many values. The first item in the list is the current valuecloud.pretty_print_cloud_data()# Pretty print the cloud dataForum Topic DataTo get the forum topic data, run the following Program:importscratchlinkscratch=scratchlink.ScratchLink()forum=scratch.link_forum(topic_id=1)# Connect a Scratch Forum Topicforum.id()# Returns the id of the forumforum.title()# Returns the title of the forumforum.category()# Returns the category of the forumforum.is_closed()# Returns whether the forum is closed or notforum.is_deleted()# Returns whether the forum is deleted or notforum.time()# Returns the activity of the forumforum.post_count()# Returns the total post count of the forumforum.posts(page=1)# Get the post in Forum Topic of a specified page. Images and some other stuff will not appear!forum.pretty_print_topic_data()# Pretty print the topic data########################################################################### IMPORTANT NOTE: To always get the updated data use the update_data() function##########################################################################forum.update_data()# Update the dataBug ReportingAll Bugs to be reported on myScratch ProfileorGithubData ProvidersData is taken from theScratch APIby the Scratch Team
andScratch DBby@DatOneLeftyon ScratchCreditsThis Library is made by@Sid72020123on ScratchChange Log11/12/2021(v0.5) - First Started Making This Library.12/12/2021(v1.0) - Updated and First Release!27/01/2022(v1.0.1) - Updated Comments APIThank You!