Multi¶
multi ¶
Multi-action YAML parser and executor.
parse_yaml ¶
Parse a YAML config file and validate its structure.
Supports a top-level 'vars' key for variable definitions. Variables are substituted in all action parameters using {{var}} syntax. Environment variables are accessible via {{env.KEY}}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to the YAML config file. |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
A list of action dicts, each with a single key (action type) |
list[dict[str, Any]]
|
and a dict of parameters. |
Raises:
| Type | Description |
|---|---|
MultiConfigError
|
If the config structure is invalid. |
Source code in wavexis/multi.py
execute_actions
async
¶
execute_actions(actions: list[dict[str, Any]], backend: Any, parallel: bool = False, cache: ActionCache | None = None) -> list[Any]
Execute each action, reusing the same backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actions
|
list[dict[str, Any]]
|
List of action dicts from parse_yaml. |
required |
backend
|
Any
|
An launched AbstractBackend instance. |
required |
parallel
|
bool
|
If True, execute all actions concurrently using separate tabs. |
False
|
cache
|
ActionCache | None
|
Optional ActionCache. If provided, cacheable actions (screenshot, dom, scrape, eval, cookies, headers) will be served from cache on repeated calls with same URL+params. |
None
|
Returns:
| Type | Description |
|---|---|
list[Any]
|
List of results from each action, in the same order as actions. |