Skip to content

Component

hhh@AIMC-714-hhh-wsl-ubuntu22 edited this page Jul 28, 2025 · 1 revision

dmlx.component

parse_locator

def parse_locator(locator: str) -> tuple[str, dict[str, object]]

Parse a component locator string into path and parameters.

  • Format: <path>?<key_0>=<value_0>;<key_1>=<value_1>;...
  • Excessive whitespace characters will be ignored
  • Pairs with keys starting with "#" will also be ignored
  • <key_*> can be any string
  • <value_*> will be converted by json.loads()

Returns:

A tuple of (path, params).

Component

def Component(module_base: str = "", default_factory_name: str | None = None, postprocessor: Callable[[Any], object] | None = None) -> Callable[[str], object]

Create a component factory loads the component according to the factory locator. (The locator string will be passed to parse_locator() to extract factory path and parameters.)

Clone this wiki locally