Project API - Quantum-Codes/ScraGet GitHub Wiki

Project:

You can get Project data from both Scratch and ScratchDB

Scratch:

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*

*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

ScratchDB:

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**

**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

Project Comments:

You can get project comments through Scratch API only.

Scratch:

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

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



Example (User API)

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*
⚠️ **GitHub.com Fallback** ⚠️