Scratch API wrapper
Project description
scratchhh
scratchhh is a kinda thin wrapper for the Scratch API. It makes things easier to fetch and use.
Installation
With pip:
python -m pip install scratchhh
Or manually:
python setup.py install
Usage
getUserProj
# Get projects from a specific user
from scratchhh.scratchhh import Scratch
Scratch.getUserProj(user, num)
getThumb
# Get a project thumbnail
from scratchhh.scratchhh import Scratch
Scratch.getThumb(id, url, file)
searchProj
# Search for projects
from scratchhh.scratchhh import Scratch
Scratch.searchProj(query, num)
getInfo
# Get project information
from scratchhh.scratchhh import Scratch
Scratch.getInfo(id)
getUserAv
# Get a user avatar
from scratchhh.scratchhh import Scratch
Scratch.getUserAv(user, url, file)
exists
# Check if a user or project exists
from scratchhh.scratchhh import Scratch
Scratch.getUserAv(ini)
getProjComments
# Get project comments
from scratchhh.scratchhh import Scratch
Scratch.getProjComments(id, num)
getUserComments
# Get user comments
from scratchhh.scratchhh import Scratch
Scratch.getProjComments(user, num)
cloneProj
# Get a project as an sb3 file
from scratchhh.scratchhh import Scratch
Scratch.cloneProj(id, file)
More features will be added as project development moves!
Examples
from scratchhh.scratchhh import Scratch
import os
ids = Scratch.getUserProj('Scratchteam', 10)
print('Getting some thumbnails :P')
os.chdir('thumbs')
for i in range(0, 10):
Scratch.getThumb(ids[i], 'thumbnail{}.png'.format(i))
from scratchhh.scratchhh import Scratch
project = Scratch.searchProj('minecraft', 1)[0]
loves = Scratch.getInfo(project)['stats']['loves']
print('This project has {} loves. WOW!'.format(loves))
from scratchhh.scratchhh import Scratch
users = ['Za-Chary', 'Scratchteam', 'Paddle2See']
print('Getting some user pfps...')
for i in range(0, len(users)):
Scratch.getUserAv(users[i], '{}.png'.format(users[i]))
from scratchhh.scratchhh import Scratch
ids = ['658095', '142', '943855']
for i in range(0, len(ids)):
print(Scratch.getProjComments(ids[i], 3))
Why scratchhh?
scratchhh offers simpler command syntax and results and a few more features than other modules, I guess.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scratchhh-0.2.65.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file scratchhh-0.2.65.tar.gz
.
File metadata
- Download URL: scratchhh-0.2.65.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 626bce7e44a4e002664dadd42c0c46437ce0862e14c57501706131322dfb112c |
|
MD5 | 9175b6603daeec0cdaddd6ffedf89978 |
|
BLAKE2b-256 | f33afa449af431f30c159f43ceecddda4a1f2384de31ccb01d6ba483ccf9a36a |
File details
Details for the file scratchhh-0.2.65-py3-none-any.whl
.
File metadata
- Download URL: scratchhh-0.2.65-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bedcd9185bad71a02e40d54e82f866204bd560eff5dc731500094230f4f3b1ce |
|
MD5 | f44d7358272d59cb9357ea75d79a70eb |
|
BLAKE2b-256 | b6adf98070bde8270cc8b580e73cce88badc23d24811fb6c132f43e1530f5284 |