Skip to main content

An API for Scratch.

Project description

scratchapi-python

PyPI - Version GitHub Release GitHub License

A scratch API wrapper for Python, created by Artcas2.

Installation

To install the library, run the following command:

pip install -U scratchapi-python

Example

import scratchapi

session = scratchapi.login("username", "password")

user = scratchapi.get_current_user()
print("Follower count:", user.get_follower_count())
print("Following count:", user.get_following_count())
print("Project cout:", user.get_project_count())

followers = user.get_followers(limit=1)
print("\nLast follower:")
for follower in followers:
    print(follower)

project = scratchapi.get_project("731849091")
print(f"\nProject stats: {project.loves} loves and {project.favorites} favs.")

Usage

Logging in with username and password

import scratchapi

session = scratchapi.login("username", "password")

Logging in with a session id

import scratchapi

session = scratchapi.Session("username", "session_id")

Session attributes

session.username
session.session_id
session.email
session.xtoken
session.new_scratcher
session.banned

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

scratchapi-python-1.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

scratchapi_python-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file scratchapi-python-1.0.0.tar.gz.

File metadata

  • Download URL: scratchapi-python-1.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for scratchapi-python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 14d6830d4cbb38215a89664b797d1c16d10267e6be55c78950eb7fa76195bc29
MD5 30fcb8a4788f2976d86134438c761c29
BLAKE2b-256 40e99ef36650161ae39e60250aa21856ddc049be87254d11692c5c7879ce7d8b

See more details on using hashes here.

File details

Details for the file scratchapi_python-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scratchapi_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dac539d44faff2d95a8a7cd0efc0f05818eb3908594988c3abd9c76d8624abd0
MD5 bf0e53c15c7def70f04744a478604099
BLAKE2b-256 7db46cfb468d02e72f1329d1fbd479a994d0cd04a8c4a5bf78dc205f1ba08179

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