scratchcloud
An asynchronous Pythonic wrapper for scratch.mit.edu cloud websockets.
Features
- Efficient asynchronous connection with Scratch.
- Event-based handling of cloud variables.
- Built-in reconnecting.
- Encoding and decoding support.
Extensions
- Fetching data from the Scratch API.
- Easily customizable codecs for encoding and decoding variables.
- Sending and parsing large cloud payloads.
- Validating the cloud by finding who changed a cloud variable.
Example
from scratchcloud import CloudClient, CloudChange
client = CloudClient('yuwe', '588579111')
@client.event
async def on_connect():
print('Connected!')
@client.event
async def on_disconnect():
print('Disconnected!')
@client.event
async def on_message(cloud: CloudChange):
print(f"{cloud.name} was set to {cloud.value}!")
await client.set_cloud(cloud.name, "123")
client.run("SuperSecretPassword22")
Links
Metadata
Release files for scratchcloud 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scratchcloud-1.2.3.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scratchcloud-1.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.4 kB
Release files / scratchcloud-1.2.3.tar.gz
| Download URL | scratchcloud-1.2.3.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
965fea27fe017fe14568d3d722a32733140eaae85aee987c2ce344e103964831
|
|
BLAKE2b-256 checksum How to use checksums |
216d750146a39180cdbbee6fb18d02215a3b132d08e12e4f292e45c7cda041ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / scratchcloud-1.2.3-py3-none-any.whl
| Download URL | scratchcloud-1.2.3-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
724bf402ab363b3e5dc9d97b5fc4e69a0508e0c32ad516cc7c8ef165383ec717
|
|
BLAKE2b-256 checksum How to use checksums |
7ed380bc2b2f199c1d1aaada978fdead3919f383ddd95d33fb6973aa5a1c5455
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|