Skip to content

CLI-related helpers

load_element_from_target

Import module and resolve attr to an :class:~streamtree.core.element.Element.

spec must be dotted.module.path:attribute where attribute is either an :class:~streamtree.core.element.Element instance or a zero-argument callable returning one.

run_streamlit_sync

Run Streamlit in a subprocess; return its exit code (2 if no script args).

On missing interpreter / streamlit module entrypoint failures that surface as :exc:FileNotFoundError from :func:subprocess.run, returns 127.