API Reference / cli /

read_algorithm.py

tuiml read-algorithm: print the source of any registered algorithm.

Thin CLI wrapper over the tuiml_read_algorithm tool. It reads both user-authored algorithms stored under ~/.tuiml/user_algorithms/ and the built-in algorithms shipped with the tuiml package.

Functions

Command

tuiml read-algorithm

Line 17
tuiml read-algorithm [OPTIONS]

Show the full source code of an algorithm, user-authored or built-in.

For a user algorithm pass the directory name, which is also the class name; the latest version is read unless --version says otherwise. For a built-in algorithm add --builtin and pass either the class name (RandomForestClassifier) or the file stem (random_forest).

The result carries the source twice, raw and with line numbers, which makes it easy to quote an exact snippet for tuiml edit-algorithm. Built-in algorithms are read-only: fork one with tuiml create-algorithm to change its behaviour.

Read the latest version of a user algorithm:

bash
$ tuiml read-algorithm --name MyKNN

Read one specific version:

bash
$ tuiml read-algorithm --name MyKNN --version 1.0.2

Read a built-in algorithm by class name:

bash
$ tuiml read-algorithm --name RandomForestClassifier --builtin

Options

--name
str required
Algorithm name (class name or directory name).
--version
str
Specific version to read (e.g. '1.0.2'). Defaults to latest.
--builtin/--no-builtin
= False
Read a built-in tuiml algorithm instead of a user algorithm.
--json-output
flag
Print the raw JSON result.