Project API - Quantum-Codes/ScraGet GitHub Wiki
You can get Project data from both Scratch and ScratchDB
from ScraGet import ScraGet #import package
project = ScraGet.get_project() #create object
project.updateScratch(476678019) #update data
print(project.title) #print required info from data*
project.id
project.title
project.description
project.instructions
project.visibility
project.public
project.commenting
project.published
project.author
project.thumbnail
project.images
project.created
project.last_modified
project.shared
project.stats
project.remix
from ScraGet import ScraGet #import package
project = ScraGet.get_project() #create object
project.updateScratchDB(476678019) #update data
print(project.title) #print required info from data**
project.id
project.thumbnail
project.title
project.description
project.instructions
project.public
project.commenting
project.author
project.created
project.last_modified
project.shared
project.ranks
project.stats
project.remix
project.metadata
You can get project comments through Scratch API only.
from ScraGet import ScraGet #import the package
comment = ScraGet.project_comments() #initialise the class
comment.get_comments(ID= 431041540, author="Ankit_Anmol", count=1) #get the comments
print(comment.comments,"\nProject creator:",comment.author) #print out the data
comment.author
comment.author_status_code #will only be returned if you didn't enter the author parameter
comment.author_response_object #This will only be returned if you didnt fill author parameter
comment.comments
comment.response_objects
Aim: Getting project description and title from project ID. Uses get_project class.
Code:
from ScraGet import ScraGet #import package
project = ScraGet.get_project() #create object
project.updateScratch(476678019) #update data
print(f"Title: {project.title}\nDesc:{project.description}") #print required info from data*