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.72.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scratchhh-0.2.72.tar.gz.
File metadata
- Download URL: scratchhh-0.2.72.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 |
a430d3835fa0d5612a8346c15b1643a750e8ea7cf1c8f4fc2abd686a0c9289f8
|
|
| MD5 |
54e99ed718d54ea0b9c49b75f56daf8a
|
|
| BLAKE2b-256 |
a871d02f02cff900c7202794134f85c95da3d2f4ae445f98a9c7fe513b8af8da
|
File details
Details for the file scratchhh-0.2.72-py3-none-any.whl.
File metadata
- Download URL: scratchhh-0.2.72-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 |
e0be1fcf80238c9439da4fc7eb10e201f4a5c977498f43018a833beaac367738
|
|
| MD5 |
af21acdd12066762440b7cf23a47f81f
|
|
| BLAKE2b-256 |
0a77320f020849cb4a9e219615f27347140a28b6b44c5f728059121305ed973d
|