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.8.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file scratchhh-0.2.8.tar.gz
.
File metadata
- Download URL: scratchhh-0.2.8.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | effdb3afaaf8a50d8e145e88d4fd6683ef14fcbb3faa5d5d88247d952d891217 |
|
MD5 | 712f34184c021b4e5c0b346831d8389e |
|
BLAKE2b-256 | a15e7a1c28b7e65621357b31f22aee4e71f6ecb06816b8202b4650916863d43f |
File details
Details for the file scratchhh-0.2.8-py3-none-any.whl
.
File metadata
- Download URL: scratchhh-0.2.8-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d22e1a17ab8e6e6061b6839cdaec55c931c42c6953d2926f1f6ae388024ed7a7 |
|
MD5 | 6f899ee7da2700cdf1e00d09e79dd414 |
|
BLAKE2b-256 | 6b054c48e315a2ba068036684ad801503c8f6cd91b5633543cf0a9eaffdae2f2 |