Skip to main content

Scratch API wrapper

Project description

scratchhh

img img

scratch

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.71.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

scratchhh-0.2.71-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file scratchhh-0.2.71.tar.gz.

File metadata

  • Download URL: scratchhh-0.2.71.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

Hashes for scratchhh-0.2.71.tar.gz
Algorithm Hash digest
SHA256 0733629a38c83b220e8185eef9ab7d32223fb04cf2ee8bf626090c73511ad555
MD5 f699b39c9e6383bab6de71c04e13b847
BLAKE2b-256 3fd7d7f9ebc28ec00645d36b9309685269a3f4583fbb0cc1d5124e5bcba20be2

See more details on using hashes here.

File details

Details for the file scratchhh-0.2.71-py3-none-any.whl.

File metadata

  • Download URL: scratchhh-0.2.71-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

Hashes for scratchhh-0.2.71-py3-none-any.whl
Algorithm Hash digest
SHA256 7a07fa2a09bbf476e5f3e0296f7b1f7ba67bbdad2edd5a637195ff8cf6b40b36
MD5 10f5af398b4e46e7de757a678762ffd9
BLAKE2b-256 69ef89c9020be21c76756f6fa906280bca268111997058b54a302a7db7b2e5e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page