A powerful WebSocket extension for Scratch.
Reason this release was yanked:
Wrong LICENSE
Project description
CloudLink Python
This is the original, Python-based codebase for CloudLink server.
💡 Features 💡
🪶 Fast and lightweight
CloudLink can run on minimal resources. At least 25MB of RAM and any reasonably capable CPU can run a CloudLink server.
🌐 Essential networking tools
- Unicast and multicast packets across clients
- Expandable functionality with a built-in method loader
📦 Minimal dependencies
All dependencies below can be installed using pip install -r requirements.txt
.
- 🐍 Python >=3.11
- 🧵 asyncio (Built-in)
- 📃 "ujson" ultrajson
- 🔍 pyeve/cerberus
- ❄️ "snowflake-id" vd2org/snowflake
- 🌐 aaugustin/websockets
🔋Batteries included
The CloudLink Python server comes with full support for the CL4 protocol and the Scratch cloud variable protocol. Just download, setup, and start!
🧱 Plug-and-play modularity
You can easily extend the functionality of the server using classes and decorators.
Here's an example of a simple plugin that displays "Foobar!" in the console
when a client sends the message { "cmd": "foo" }
to the server.
# Import the server
from cloudlink import server
# Import default protocol
from cloudlink.server.protocols import clpv4
# Instantiate the server object
server = server()
# Set logging level
server.logging.basicConfig(
level=server.logging.DEBUG
)
# Load default CL protocol
clpv4 = clpv4(server)
# Define the functions your plugin executes
class myplugin:
def __init__(self, server, protocol):
# Example command - client sends { "cmd": "foo" } to the server, this function will execute
@server.on_command(cmd="foo", schema=protocol.schema)
async def foobar(client, message):
print("Foobar!")
# Load the plugin!
myplugin(server, clpv4)
# Start the server!
server.run()
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
Hashes for cloudlink-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7345be56164d41299d81dd579871fcec46f0b82b1f435e0bca878194cfaaff3d |
|
MD5 | c6444a6a1dcd4928de2135679aa11682 |
|
BLAKE2b-256 | 14f979c77e1d21238258196e4d891d71b83d5e77c5cad9f36c00c0e9b41c960d |