Skip to content

Converter hooks

BrkRaw supports converter hook packages that extend the conversion pipeline without modifying the core library.

Hooks are distributed as normal Python packages, discovered via entry points, and installed into your BrkRaw config root as addon files (specs, rules, pruner specs, transforms).


List available hooks

Show detected hook packages (installed status included):

brkraw hook list

If nothing appears, verify that the hook package is installed in the same Python environment as brkraw.


Install a hook

Install hook addons by hook name (or by entrypoint name):

brkraw hook install <hook-name>

Install all detected hooks at once:

brkraw hook install all

Reinstall if a newer version is available:

brkraw hook install <hook-name> --upgrade

Read hook documentation

Print the hook's bundled documentation (if provided by the hook manifest):

brkraw hook docs <hook-name>

Render markdown nicely in the terminal (requires rich):

brkraw hook docs <hook-name> --render

Generate hook argument presets

When a hook supports many optional arguments, generate a YAML template:

brkraw hook preset <hook-entrypoint> -o hook_args.yaml

Then pass it to brkraw convert:

brkraw convert /path/to/study --scan-id 14 --hook-args-yaml hook_args.yaml

Uninstall a hook

Remove the installed hook addons from the config root:

brkraw hook uninstall <hook-name>

If dependencies are detected, uninstall may stop. To remove anyway:

brkraw hook uninstall <hook-name> --force

Note: uninstalling the hook addons does not uninstall the Python package. To remove the package itself:

pip uninstall <hook-name>

Example: brkraw-mrs

Install the hook package:

pip install brkraw-mrs

Install its addons into BrkRaw:

brkraw hook install brkraw-mrs

Optionally, view its docs:

brkraw hook docs brkraw-mrs --render

After installation, run conversion as usual. The hook is applied automatically when the dataset matches the hook's conditions:

brkraw convert /path/to/study --scan-id 14