An API for Scratch.
Project description
scratchapi-python
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 = session.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scratchapi-python-1.0.1.tar.gz
.
File metadata
- Download URL: scratchapi-python-1.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 527bcf52e25e40ce3437201b0f754756c6328ff7f79ce8eb88e52b148e99bd19 |
|
MD5 | 823e6f083bd436479758da8e2f2b1613 |
|
BLAKE2b-256 | 8d3da36198f16dc023474136e57aafa8437f065039d2a5898c23a240ba5b333f |
File details
Details for the file scratchapi_python-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: scratchapi_python-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c04ad7501cdc07c7703bf1375767cfbaeba6be3d134b6dbfc9513068617c6efc |
|
MD5 | 341684a3613d9a6ba27ab8d96dc1a0ad |
|
BLAKE2b-256 | 3abbec1dea9600958afe36843f4ce4102051d9af70ef42581f8735fa6921386d |