Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- CoolMathStuff
-
9 posts
scratchattach - A Scratch API wrapper (Python)
My code isn't working right, I think scratch API is down:
![](//cdn.scratch.mit.edu/scratchr2/static/__74e70580e9dbe93ce1c3f8422dde592d__/djangobb_forum/img/smilies/sad.png)
import os
from keep_alive import keep_alive
os.system(“pip install scratchattach”)
os.system(“pip install requests”)
import scratchattach as scratch3
import requests
import json
keep_alive()
session = scratch3.Session(os.environ, username=“CoolMathStuff”)
conn = session.connect_cloud(project_id=“968644178”)
client = scratch3.CloudRequests(conn)
@client.request
def get_user(argument1):
print(f“requests for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is ready”)
client.run()
Either that, or replit doesn't have the right library…
![](http://cdn.scratch.mit.edu/scratchr2/static/__74e70580e9dbe93ce1c3f8422dde592d__/djangobb_forum/img/smilies/sad.png)
import os
from keep_alive import keep_alive
os.system(“pip install scratchattach”)
os.system(“pip install requests”)
import scratchattach as scratch3
import requests
import json
keep_alive()
session = scratch3.Session(os.environ, username=“CoolMathStuff”)
conn = session.connect_cloud(project_id=“968644178”)
client = scratch3.CloudRequests(conn)
@client.request
def get_user(argument1):
print(f“requests for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is ready”)
client.run()
Either that, or replit doesn't have the right library…
Last edited by CoolMathStuff (Feb. 24, 2024 23:42:37)
- Knightbot63
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
What is the error you are getting when trying to run the code? My code isn't working right, I think scratch API is down
Working on an RPG. Consistently losing followers because of inactivity.
I head to forums time-to-time. Not as much as I used to.
- scaryghost14
-
53 posts
scratchattach - A Scratch API wrapper (Python)
cool
play https://scratch.mit.edu/projects/860188790/ it is fun
![](http://cdn.scratch.mit.edu/scratchr2/static/__74e70580e9dbe93ce1c3f8422dde592d__/djangobb_forum/img/smilies/cool.png)
when I receive [I'm board v]
follow [scaryghost14]
- Eason_9
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
(#2282)bump for my post(#2281)I tried, but it said that requirements are already satisfied and refused to download
So you must have downloaded the file onto your pc when you ran the command in the cmd. To use scratchattach in vs code download scratchattach using the terminal in vs code.
*This is my signature, more info on it here! Scroll down by highlighting anywhere and press shift and the down arrow key.
Get your images up to the forums with my shop: Imagif Hosters (for free!)
If you have some time to spare, perhaps go read my Scratch Wiki essays!
And since I'm here I should probably advertise my projects but I can't find a good project I made.
11 (almost 12) - He/Him
If you have some time to spare, perhaps go read my Scratch Wiki essays!
And since I'm here I should probably advertise my projects but I can't find a good project I made.
11 (almost 12) - He/Him
- nexoalex
-
79 posts
scratchattach - A Scratch API wrapper (Python)
it is possible to hack like i have a concept to hack cloud variables but ill just wait till i make a vidBy changing variables on a different project - and it's not really a hack. Check out how do you use the api for hackingthe scratchattach wiki to learn how to use scratchattach, and of course, make sure you know Python well
Hello i am teh epik duck coder
YT: https://www.youtube.com/channel/UCCZqvGQ8D5mZ5l4ls6jEFMg
WEBSITE: https://nexoalex.w3spaces.com
- ajskateboarder
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I never said it was impossible..it is possible to hack like i have a concept to hack cloud variables but ill just wait till i make a vidBy changing variables on a different project - and it's not really a hack. Check out how do you use the api for hackingthe scratchattach wiki to learn how to use scratchattach, and of course, make sure you know Python well
- DocParker
-
7 posts
scratchattach - A Scratch API wrapper (Python)
Use pycharm and install it Scratch3.py isn't working for me.
- TimMcCool
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
Update - v1.6.2
- Added `client.stop()` to cloud requests (will stop cloud request handler and all background event handlers)
- You can now access the letters used by the encoder: `scratch3.encoder.letters`
- Added `scratch3.Encoding.replace_char(“old_char”, “new_char”)`
- Added `studio.accept_invite()`
- Added `project.upload_json_from(“other_project_id”)`
- `scratch3.connect_tw_cloud(“project_id”)` - “project_id” arg can now be a non-integer
- Added `daemon` argument to `client.run()` (cloud requests)
- Added `client.stop()` to cloud requests (will stop cloud request handler and all background event handlers)
- You can now access the letters used by the encoder: `scratch3.encoder.letters`
- Added `scratch3.Encoding.replace_char(“old_char”, “new_char”)`
- Added `studio.accept_invite()`
- Added `project.upload_json_from(“other_project_id”)`
- `scratch3.connect_tw_cloud(“project_id”)` - “project_id” arg can now be a non-integer
- Added `daemon` argument to `client.run()` (cloud requests)
Developer of scratchattach, the most popular Python Scratch API wrapper
- TimMcCool
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
PyCharm community edition is freePyCharm isn't free?Use pycharm and install it Scratch3.py isn't working for me.
Last edited by TimMcCool (Feb. 28, 2024 12:21:42)
Developer of scratchattach, the most popular Python Scratch API wrapper
- ajskateboarder
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
You can use any editor/IDE to install scratchattach, by the wayUse pycharm and install it Scratch3.py isn't working for me.
- leahcimto
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
so are we all just going to pretend that this isn't a complete copy of scratchclient
- grandpasp
-
36 posts
scratchattach - A Scratch API wrapper (Python)
As ScratchAttach is just a wrapper for the Scratch API, it must be expected to be functionally the same as any other. so are we all just going to pretend that this isn't a complete copy of scratchclient
- scaryghost14
-
53 posts
scratchattach - A Scratch API wrapper (Python)
pycharm works right?
play https://scratch.mit.edu/projects/860188790/ it is fun
![](http://cdn.scratch.mit.edu/scratchr2/static/__74e70580e9dbe93ce1c3f8422dde592d__/djangobb_forum/img/smilies/cool.png)
when I receive [I'm board v]
follow [scaryghost14]
- TimMcCool
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
scratchattach has more and better features than scratchclient. so are we all just going to pretend that this isn't a complete copy of scratchclient
It's not just an API wrapper, but a tool for sending data through cloud variables fastly and easily (built-in encoding, cloud requests framework). It can still be used as an API wrapper tho. scratchattach supports more API endpoints than scratchclient, and many scratchattach features don't require a login which can be an advantage.
yes, all IDEs should work pycharm works right?
Last edited by TimMcCool (March 5, 2024 18:42:28)
Developer of scratchattach, the most popular Python Scratch API wrapper
- AwesomePeopleOutTher
-
22 posts
scratchattach - A Scratch API wrapper (Python)
pycharm works very well with scratchattach and makes it incredibly easy to install scratchattach. pycharm works right?
![](https://cdn2.scratch.mit.edu/get_image/user/57845141_32x32.png)
- hellopeepos1
-
7 posts
scratchattach - A Scratch API wrapper (Python)
Just a quick question, but can ScratchAttach be used to make an account system for a game or no? Because considering that Python can store values sent through the cloud into a local variable, you can just have it be saved in the IDE and send the data when requested. Either that or I'm getting it completely wrong lol.
Last edited by hellopeepos1 (March 9, 2024 13:55:13)
- scaryghost14
-
53 posts
scratchattach - A Scratch API wrapper (Python)
thxscratchattach has more and better features than scratchclient. so are we all just going to pretend that this isn't a complete copy of scratchclient
It's not just an API wrapper, but a tool for sending data through cloud variables fastly and easily (built-in encoding, cloud requests framework). It can still be used as an API wrapper tho. scratchattach supports more API endpoints than scratchclient, and many scratchattach features don't require a login which can be an advantage.yes, all IDEs should work pycharm works right?
play https://scratch.mit.edu/projects/860188790/ it is fun
![](http://cdn.scratch.mit.edu/scratchr2/static/__74e70580e9dbe93ce1c3f8422dde592d__/djangobb_forum/img/smilies/cool.png)
when I receive [I'm board v]
follow [scaryghost14]
- redspacecat
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
I'm pretty sure that would work Just a quick question, but can ScratchAttach be used to make an account system for a game or no? Because considering that Python can store values sent through the cloud into a local variable, you can just have it be saved in the IDE and send the data when requested. Either that or I'm getting it completely wrong lol.
Highlight and do Shift + Down Arrow to see the rest of my signature.
Click Here To Get A Scratch 4.0 Sneak Peak!
![](https://assets.scratch.mit.edu/get_image/.%2E/74e8193018c1f4748cd4181e4829cda6.png)
You should probably know that I don't actually use forbidden word, I just use this bookmarklet to upload to the assets server. I wonder who else knows what forbidden word is.
You got TROLLED
![](https://assets.scratch.mit.edu/get_image/.%2E/0671ac9aa5e7893f1d30eba11b2e5e0d.jpg)