Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchclient - A scratch API wrapper for python
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
A few days ago I noticed there was no easy way to mess with scratch's API in Python so I created a python module to do this. https://pypi.org/project/scratchclient/
You can install it using
Thanks to this npm package for the reference code and ilcheese2 for their modified version of my cloud code.
You can report issues on the (email removed by moderator - please don't share contact information) this topic, or my scratch profile.
Usage:
Basic usage:
Cloud connection:
I havent made documentation yet because I'm lazy
so feel free to ask questions in this topic.
You can install it using
pip install scratchclient
Thanks to this npm package for the reference code and ilcheese2 for their modified version of my cloud code.
You can report issues on the (email removed by moderator - please don't share contact information) this topic, or my scratch profile.
Usage:
Basic usage:
from scratchclient import ScratchSession session = ScratchSession("ceebee", "--uwu--") # post comments session.get_user("Paddle2See").post_comment("OwO") # lots of other stuff print(session.get_project(450216269).get_comments()[0].content) print(session.get_studio(29251822).description)
from scratchclient import ScratchSession session = ScratchSession("griffpatch", "SecurePassword7") connection = session.create_cloud_connection(450216269) connection.set_cloud_variable("variable name", 5000) @connection.on("set") def on_set(variable): print(variable.name, variable.value) print(connection.get_cloud_variable("other variable"))
I havent made documentation yet because I'm lazy

Last edited by Paddle2See (Aug. 10, 2022 17:07:04)
- scratchieguy12345678
-
500+ posts
scratchclient - A scratch API wrapper for python
That looks really cool! I'm going to have to try that out!
- 9gr
-
1000+ posts
scratchclient - A scratch API wrapper for python
make bbcode reading possible and ill be happy
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
What do you mean? make bbcode reading possible and ill be happy
- Chiroyce
-
1000+ posts
scratchclient - A scratch API wrapper for python
basically it takes raw BBCODE data from the api like this What do you mean?
[color=red] nono word [/color]
nono word
Last edited by Chiroyce (April 22, 2021 09:15:25)
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
There's no API for the forums… I guess I can implement ScratchDB but that sort of defeats the purpose…basically it takes raw BBCODE data from the api like this What do you mean?and will show it like this[color=red] nono word [/color]nono word
- Chiroyce
-
1000+ posts
scratchclient - A scratch API wrapper for python
what I meant was getting posts using a get request There's no API for the forums…

- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
You mean webscraping?what I meant was getting posts using a get request There's no API for the forums…
- 9gr
-
1000+ posts
scratchclient - A scratch API wrapper for python
noYou mean webscraping?what I meant was getting posts using a get request There's no API for the forums…
GET scratch.mit.edu/discuss/post/postid/source
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
Oop, apparently I was wrong. I'll add it the next time I update it.noYou mean webscraping?what I meant was getting posts using a get request There's no API for the forums…
GET scratch.mit.edu/discuss/post/postid/source
- PikachuB2005
-
100+ posts
scratchclient - A scratch API wrapper for python
@Raihan142857 Can you include a list of ALL of the functions?
BTW I have my own github repo for interacting with scratch's api, but I would like to try yours. I made this thing with mine.
BTW I have my own github repo for interacting with scratch's api, but I would like to try yours. I made this thing with mine.
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
I'm going to add documentation later. @Raihan142857 Can you include a list of ALL of the functions?
BTW I have my own github repo for interacting with scratch's api, but I would like to try yours. I made this thing with mine.
- 9gr
-
1000+ posts
scratchclient - A scratch API wrapper for python
Imma use your code for the new api docs I'm makingI'm going to add documentation later. @Raihan142857 Can you include a list of ALL of the functions?
BTW I have my own github repo for interacting with scratch's api, but I would like to try yours. I made this thing with mine.
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
is anyone willing to help me write docs? there's a lot of stuff I need to document and help would be appreciated
- silvxrcat
-
500+ posts
scratchclient - A scratch API wrapper for python
sure i'll help, i know basic md is anyone willing to help me write docs? there's a lot of stuff I need to document and help would be appreciated
- scratchieguy12345678
-
500+ posts
scratchclient - A scratch API wrapper for python
is anyone willing to help me write docs? there's a lot of stuff I need to document and help would be appreciated
I'll help, I've already looked at the code and I understand it well.
- 9gr
-
1000+ posts
scratchclient - A scratch API wrapper for python
mkdocs please is anyone willing to help me write docs? there's a lot of stuff I need to document and help would be appreciated
- Raihan142857
-
1000+ posts
scratchclient - A scratch API wrapper for python
I'm just gonna put it on the wiki for the gh repomkdocs please is anyone willing to help me write docs? there's a lot of stuff I need to document and help would be appreciated
- Yeetoburro1
-
1000+ posts
scratchclient - A scratch API wrapper for python
Hi, for some reason connecting to a project is taking infinitely long for me, wondering if this is a common issue or..
edit: king of the page hahaaha
edit: king of the page hahaaha
Last edited by Yeetoburro1 (May 19, 2021 03:56:24)
- Discussion Forums
- » Advanced Topics
-
» scratchclient - A scratch API wrapper for python