dlgforge.utils.text¶
Text hashing and template rendering helpers.
hash_text(text)
¶
Hash text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Input text. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Value produced by this API. |
Raises:
| Type | Description |
|---|---|
Exception
|
Propagates unexpected runtime errors from downstream calls. |
Side Effects / I/O: - Primarily performs in-memory transformations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.utils.text import hash_text
>>> hash_text(...)
render_template(template, values)
¶
Render template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template
|
str
|
Input text. |
required |
values
|
Dict[str, Any]
|
Dict[str, Any] value used by this operation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Value produced by this API. |
Raises:
| Type | Description |
|---|---|
Exception
|
Propagates unexpected runtime errors from downstream calls. |
Side Effects / I/O: - Primarily performs in-memory transformations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.utils.text import render_template
>>> render_template(...)