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)

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

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

Uploaded Source

Built Distribution

scratchhh-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scratchhh-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 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.0.tar.gz
Algorithm Hash digest
SHA256 ed03ae1a1225b81d7cb79dba21418f6c9f9f62050b749fbcc85ebdfae5f7e9e7
MD5 56b982b66e8a56cc4ed2ef8998165c16
BLAKE2b-256 02c6437402d9b75da64e947b6e64908191d0ca637b707b79e9e699e0d30c853f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scratchhh-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b030780e3bfb31370877fd0e903d788fa2f8916cc83ec5c2970a1304eb4c2e
MD5 82d5ae24746243e83666143d4bfe0ac1
BLAKE2b-256 340f1af8059d3bccb3ed10b8c284390f27cec9f8c66014fb6fba7808463ca8e2

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