Skip to main content

Python to Scratch API connector

Project description

Scratch2py

Scratch2py or S2py is a easy to use, versatile tool to communicate with the Scratch API Based of scratchclient by Raihan142857

Installation

pip install scratch2py

Use your terminal and run this command to install Scratch2py Then, import the module into your python file like this:

import scratch2py
s2py = scratch2py.constructer('username', 'password')
# Imports s2py and initializes a new s2py object. Enter your Scratch MIT credentials to create a connection with the API.

Usage

How to use S2py

Projects

Using the module for projects

s2py.getStats('id', 'stat')
# Gets the stats of a project. First input is the project ID, the second one is what stat you want (Loves, faves, views or remixes)
s2py.getProjectComments('id')
# Gets the comments of a project based on the project ID. Data returned in JSON.

Studios

Using the module for a studio

s2py.getStudioComments('id')
# Gets the comments of a studio based on the ID.

User

Using the module for getting user data

s2py.getUserStatus('user')
# Gets the 'about me' section of a users.
s2py.getUserBio('user')
# Gets the 'What I'm Working On' section of a users profile.
s2py.getUserFollowersCount('user')
# Gets the number of followers for a user
s2py.getUserMessagesCount('user')
# Gets the number of messages someone has.
s2py.checkUserExists('user')
# Checks if a user exists. Returns true or false
s2py.getProjects('user')
# Gets the titles and project IDs of a user.

Cloud

Using the module for cloud.

s2py.cloudConnect('Project ID')
# Starts a cloud connection to a specific project
s2py.setCloudVar('CloudVar', 'Value')
# Sets a value to a cloud variable. Don't add the cloud symbol.
s2py.readCloudVar('variable name', 'Limit(optional)')
# Gets the value of a cloud variable. Limit is when the program should stop looking for the value. Limit is 1000 by default.

The End

That's it! Contact my on my Scratch profile

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

scratch2py-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

scratch2py-0.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file scratch2py-0.0.1.tar.gz.

File metadata

  • Download URL: scratch2py-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for scratch2py-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0fa4d117586731a7803ab448f3c6b4bb7e481b80e5a9cfdb307f6b7c2289658d
MD5 c5c46b839a3e01d19d0e2854c14e5e23
BLAKE2b-256 a22e8943eea7c4cb294f7d7c79f9efa410fe23b1bd443556c838d8e0a3d3aebd

See more details on using hashes here.

File details

Details for the file scratch2py-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: scratch2py-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for scratch2py-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66b8b7f80593738a9cdb1a338298574b1eb773dec813af8174cc6df80b2f040c
MD5 b00ec9abd2ff6d32a00485b47c77b6a0
BLAKE2b-256 62e505568a378065a994a49b65ca1f1bf521345230c0f67ffd8de6feec4e69a8

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