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.7.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file scratchhh-0.2.7.tar.gz
.
File metadata
- Download URL: scratchhh-0.2.7.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 | f23965fbf190672de70e356eedccf81f689e042bf37aed84221f4f84fd368b03 |
|
MD5 | 3edbda92f09934b3c02dae06a0c115df |
|
BLAKE2b-256 | d72692dc4d27be60774766b5a4b820456a2b94a35e8dfed32de74e0830ce88f7 |
File details
Details for the file scratchhh-0.2.7-py3-none-any.whl
.
File metadata
- Download URL: scratchhh-0.2.7-py3-none-any.whl
- Upload date:
- Size: 4.3 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 | 6459bb92ed2969a5fee1b87f504606e8df6ae83a6295cfe7ac4da78923a49413 |
|
MD5 | f68e3416089aeb6a421c192cb3883bb5 |
|
BLAKE2b-256 | 39eb98c1a171e47f5056fe98f2e80e9cd7e10c81230e3fe68f86220420efda1f |