An event-based asynchronous wrapper for scratch.mit.edu cloud variables.
Reason this release was yanked:
Incorrect versions: not intended to work with python versions 3.8, 3.9.
Project description
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
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
scratchcloud-1.1.0.tar.gz
(16.3 kB
view hashes)
Built Distribution
Close
Hashes for scratchcloud-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e58c401996ed205ac500c1fff65d67d0138336a84e766f258ee81aa7a36e1138 |
|
MD5 | dec14c943048d378ff1ce4f859c835d0 |
|
BLAKE2b-256 | 02317012d0e1f229a39e85c3b9d05604632d86eb24803d7ce76b8adaa4cb6e7f |