Ascender LiveAPI Protocol (ALP)
Ascender LiveAPI Protocol (ALP) is a structured, Socket.IO-based event system for real-time communication between clients and backend services. It is simple and easy-to-use implementation of SocketIO into Ascender Framework with framework's architecture and DI support.
Getting Started
Prerequisites
Ensure you have the following dependencies installed:
- Python 3.11 or higher
- Ascender Framework 2.0 or higher
- Poetry (for dependency management)
- pip (Python's package manager)
Installation
-
Initiate Ascender Framework Project (if not already):
ascender new --name example-alp ... cd example-alp
-
Add ALP as a package to the project:
poetry add ascender-alp
-
Add provider in bootstrap: In
src/bootstrap.pyadd# src/bootstrap.py from alp import provideALP from ascender.core.types import IBootstrap appBootstrap: IBootstrap = { "providers": [ provideALP() ] }
-
Add an ALPReceiver in your controller: To handle incoming events/messages, use decorator
@ALPReceiverin your controller.from alp import ALPReceiver @Controller( standalone=True, ) class ChatGateway: @ALPReceiver("connect", namespace="/chats") async def handle_connect(self, sid: str): print(f"[ALP] Client connected: {sid}") @ALPReceiver("chat-toggle", namespace="/chats") async def toggle_chat(self, sid: str, data: UUID): print(f"[ALP] Chat toggled: {data}") return {"status": "ok"}
-
Emit event / Send message via Transmitter: If you need to send message or emit any event, you can use ALP's
TransmitterModuleandTransmitterobject. To useTransmitterobject, you should importTransmitterModulein yourAscModuleorControllerif one is standalone specifying namespace if required.from alp import TransmitterModule, ALPReceiver, Transmitter from ascender.common import BaseDTO class MessageDTO(BaseDTO): sender_id: str message: str @Controller( standalone=True, imports=[ TransmitterModule.with_namespace("/chats") ] ) class ChatGateway: def __init__(self, transmitter: Transmitter): self.transmitter = transmitter @ALPReceiver("connect", namespace="/chats") async def handle_connect(self, sid: str): await self.transmitter.emit("message", MessageDTO(sender_id=sid, message=f"User {sid} joined the chat."), room="cool_convo", namespace="/chat") await self.transmitter.enter_room(sid, "cool_convo", namespace="/chat") print(f"[ALP] Client connected: {sid}") @ALPReceiver("message", namespace="/chats") async def handle_message(self, sid: str, data: MessageDTO): await self.transmitter.emit("message", data, room="cool_convo", namespace="/chat") return {"status": "ok"}
If everything works, you're done!
Roadmap
- Typescript ALP Client
- CLI generator for ALP based controllers
- Built-in reconnection helpers
- Websocket testing utils
- Native websocket support
- Additional transportation protocols support
License
MIT © 2025 Ascender Projects
Get Involved
Have feedback? Submit issues, PRs, or ideas - let’s make real-time Ascender-native and beautiful. Don’t forget to star ⭐ the repo if you like it.
Metadata
Release files for ascender-alp 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ascender_alp-0.0.2.tar.gz | 6.1 kB | Without provenance | Details for ascender_alp-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ascender_alp-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for ascender_alp-0.0.2-py3-none-any.whl |
Total release size: 15.8 kB
Release files / ascender_alp-0.0.2.tar.gz
| Download URL | ascender_alp-0.0.2.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec14ddde72178217ae91d658d2f2b1c2ada7c65eb447fbb274dae43982e28ebb
|
|
BLAKE2b-256 checksum How to use checksums |
c95561847335e78029d2c0b788fadb6ed82dee4aedf7fa1b9b2bee25b39e38a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.13 Linux/6.14.8-asahi-1-1-ARCH
|
Release files / ascender_alp-0.0.2-py3-none-any.whl
| Download URL | ascender_alp-0.0.2-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
358120ecc2256a0d1bf0f5ee7bdbfa477684684b719ac164fe030acc164f53ad
|
|
BLAKE2b-256 checksum How to use checksums |
9f3ca7fde18ec6fa8eb25629ff468c59f974b6121f20c08f546150dc15118f47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.13 Linux/6.14.8-asahi-1-1-ARCH
|
Security for ascender-alp 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.