Assemblyline API and Socket IO server
raw JSON → 4.7.3.1 verified Mon Apr 27 auth: no python
Assemblyline 4 - API and Socket IO server. Version 4.7.3.1 is the latest. The project is under active development (pre-1.0), with frequent releases. Part of the Assemblyline suite by the Canadian Centre for Cyber Security.
pip install assemblyline-ui Common errors
error ModuleNotFoundError: No module named 'assemblyline_ui' ↓
cause The package assemblyline-ui is not installed in the current environment.
fix
Install with 'pip install assemblyline-ui'
error AttributeError: module 'assemblyline_ui' has no attribute 'api' ↓
cause Importing the top-level package instead of the submodule.
fix
Use 'from assemblyline_ui.api import AssemblylineAPI' instead of 'import assemblyline_ui'
Warnings
breaking Configuration format changed between v4.0 and v4.1. The 'forge.get_config()' no longer accepts a file path parameter; it reads from environment variables or a default config. ↓
fix Use 'forge.get_config()' without arguments, and set ASSEMBLYLINE_CONFIG environment variable or place config in standard location.
deprecated The 'from assemblyline_ui import api as api_module' import path is deprecated. Use direct submodule imports. ↓
fix Replace with 'from assemblyline_ui.api import AssemblylineAPI'
gotcha When running tests, ensure the socket.io server is not initialized unless explicitly needed, as it may block the event loop. ↓
fix Import SocketIOServer only inside async functions or use conditionals.
Imports
- AssemblylineAPI wrong
from assemblyline_ui import AssemblylineAPIcorrectfrom assemblyline_ui.api import AssemblylineAPI - SocketIOServer wrong
from assemblyline_ui import SocketIOServercorrectfrom assemblyline_ui.socketio import SocketIOServer
Quickstart
from assemblyline_ui.api import AssemblylineAPI
from assemblyline.common import forge
# Initialize using a configuration dict
config = forge.get_config()
api = AssemblylineAPI(config)
# Example: list submissions
submissions = api.list_submissions()
print(submissions)