User API - Quantum-Codes/ScraGet GitHub Wiki

User:

You can get User data from both Scratch and ScratchDB
Didn't find what you were looking? Search here.

Scratch:

from ScraGet import ScraGet #import package
user = ScraGet.get_user() #create object
user.updateScratch("griffpatch") #update data
print(user.id) #print required info from data*

*Data:

user.username #returns username 
user.id #returns user id
user.join_date #returns joindate
user.scratchteam #returns if scratchteam or not.(true or false)
user.profile_stats #returns a dictionary of user info
user.profile_id #returns some ID? I honestly don't know.. create a discussion and inform me
user.pfp #returns a 90×90 sized image
user.country #returns country of user
user.AboutMe # about me of user
user.wiwo # what I'm working on of user

ScratchDB:

from ScraGet import ScraGet #import package
user = ScraGet.get_user() #create object
user.updateScratchDB("griffpatch") #update data
print(user.id) #print required info from data**

**Data:

user.username #returns username
user.id #returns user id
user.pfp #returns PFP link (size:90×90)
user.join_date #returns joining date
user.country #returns country of user
user.AboutMe #returns "about me" of user
user.wiwo #returns "What Im Working On" of user
user.status #returns whether user is Scratcher,New Scratcher or Scratch team
user.school #returns the school ID. 
user.country_rank #returns a dictionary of ranks in country
user.rank #returns a dictionary of ranks in the whole Scratch website
user.stats #returns a dictionary of statistics about followers, loves, etc



Example (User API)

Aim: Inputting a Wrongly capitalized username and converting it to correct one! Uses get_user class.

Code:

import os
os.system("pip install ScraGet") #installs this package
os.system("clear") #clears console/display

from ScraGet import ScraGet #import package
user = ScraGet.get_user() #create class

while True: #forever loop
  user.updateScratch(input("Wrongly capitalized username: ")) #ask user then get data
  print(f"Correct username: {user.username}") #print actual username
  print()
⚠️ **GitHub.com Fallback** ⚠️