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. |
Source code in wavexis/multi.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |