Starlark Built-in Modules
Minimal's Lark steps run Starlark — a sandboxed, deterministic subset of Python. Built-in modules extend what you can do beyond core Starlark.
Load a module at the top of your code block before using any function from it:
load("math", "upby10")
load("strings", "slugify")
math
load("math", "upby10")
| Function | Description | Example |
|---|---|---|
upby10(n) | Multiplies n by 10 | upby10(5) → 50 |
strings
load("strings", "slugify")
| Function | Description | Example |
|---|---|---|
slugify(s) | Converts string to URL-safe slug | slugify("Hello World") → "hello-world" |
Core Starlark — No Load Required
These are available in every Lark step without loading:
| Function | Description | Example |
|---|---|---|
len(x) | Length of list or string | len(step_0) → 42 |
str(x) | Convert to string | str(123) → "123" |
int(x) | Convert to integer | int("42") → 42 |
range(n) | Integer range | range(3) → [0, 1, 2] |
print(x) | Log to server output | print(step_0) |
What Starlark Does Not Support
Starlark is intentionally limited for safety and determinism. These Python features are not available:
| Not supported | Use instead |
|---|---|
import | Use load() |
| f-strings | String concatenation — "hello " + name |
try / except | Validate input before using it |
class | Use dicts instead |
| Generators | Use explicit for loops with append |
None | Use "" or 0 as empty values |
tip
If you need something not available in Starlark, do the heavy transformation in SQL and use Lark only for shaping the output.