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, 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)

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

Uploaded Source

Built Distribution

scratchhh-0.2.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scratchhh-0.2.5.tar.gz
  • Upload date:
  • Size: 3.8 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.5.tar.gz
Algorithm Hash digest
SHA256 deb348695e8636e2a95a8b95ec834f764a5e90dd273aedd11ee3118d1efd1485
MD5 27803d9d076550f99ad6ecbc948e0945
BLAKE2b-256 48e76f7f5b1565103b3d536a5559b9d5fe8f9298efe6323e40f84ffd9c4e9119

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scratchhh-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0284f7fafe6de38b79aa340138e2d0610e27679a45ee6ec5311af7829efad72a
MD5 72014315b84816fd860e89373d5c5fb9
BLAKE2b-256 26684c77558ced3ff67af46c9afe39bebbba4c9b1682afb567b5bfb902454fd8

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