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
.
🔋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.
from cloudlink import server
from cloudlink.server.protocols import clpv4
server = server()
server.logging.basicConfig(
level=server.logging.DEBUG
)
clpv4 = clpv4(server)
class myplugin:
def __init__(self, server, protocol):
@server.on_command(cmd="foo", schema=protocol.schema)
async def foobar(client, message):
print("Foobar!")
myplugin(server, clpv4)
server.run()