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, 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, 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.6.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file scratchhh-0.2.6.tar.gz
.
File metadata
- Download URL: scratchhh-0.2.6.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 | 8a57cd0056c05417c5000d501c156d43800e323a1f63bb107565535068dea99a |
|
MD5 | adedc37f8b6f897909e17eedca7a1636 |
|
BLAKE2b-256 | a7a33c3256c12b00e9ba84e92228df3b05f9506afd053e6a4715ceb3ba92102c |
File details
Details for the file scratchhh-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: scratchhh-0.2.6-py3-none-any.whl
- Upload date:
- Size: 4.5 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 | 73b5ef9a9dd6810b8eb4db393bdb03a24e65fa8746f30d03400c70b1e7862faf |
|
MD5 | 946205e256eaaf6c2c4d04829ed9738c |
|
BLAKE2b-256 | 35c411041754aca16e4116d38a9bcec74ad5f7563543c2e76cc9ea686d446447 |