Parameter Resolver API
The parameter resolver expands ${...} placeholders inside any
nested string / list / dict structure. It is invoked automatically on
every task before the user template touches it, so values flow
seamlessly between actions.
Resolver
from je_load_density import parameter_resolver, resolve
parameter_resolver.set_variable("base", "https://api.example.com")
parameter_resolver.set_variables({"token": "abc", "tenant": "acme"})
parameter_resolver.add_csv_source("users", "users.csv")
parameter_resolver.clear()
expanded = resolve({"url": "${var.base}/login", "id": "${uuid()}"})
Public helpers
from je_load_density import (
register_variable, register_variables,
register_csv_source, register_csv_sources,
resolve,
)
register_variable("base", "https://api.example.com")
register_variables({"tenant": "acme", "token": "abc"})
register_csv_source("users", "users.csv")
register_csv_sources([
{"name": "products", "file_path": "products.csv", "cycle": False},
])
payload = resolve({
"url": "${var.base}/login",
"json": {"email": "${csv.users.email}",
"password": "${csv.users.password}"},
})
Supported placeholders
Placeholder |
Resolves to |
|---|---|
|
Value passed to |
|
Environment variable |
|
Next row of CSV source |
|
Calls |
|
New UUID 4 string. |
|
Local ISO-8601 timestamp (seconds). |
|
Cryptographically-strong random int in |
Extractors
Tasks may declare extract rules; matching values are written back
into the resolver under the chosen variable name. Sources:
json_path, header, status_code.
{
"method": "post",
"request_url": "${var.base}/login",
"extract": [
{"var": "auth_token", "from": "json_path", "path": "data.token"},
{"var": "request_id", "from": "header", "name": "X-Request-Id"}
]
}
Subsequent tasks can read ${var.auth_token} straight from the
resolver.
Action-JSON commands
Command |
Summary |
|---|---|
|
Register one or many |
|
Bind a CSV file to a |
|
Reset every registered variable / source. |