API reference
Roadshow includes the Typer CLI and Rich renderer, with py-buzz as its error base.
Core
roadshow.core
Discover, inspect, and capture Python demo functions.
DemoDetails
dataclass
Store the displayable parts of a demo function.
DemoResult
dataclass
capture_demo
capture_demo(
function: DemoFunction,
*,
input_text: str | None = None,
input_lines: Sequence[str] | None = None,
argv: Sequence[str] | None = None,
isolate_home: bool = True,
) -> DemoResult
Run a demo while capturing standard streams, input, and process exit.
decompose_demo
Extract a demo function's docstring and executable body.
demo
demo(
feature: str,
*,
before: Callable[[], object] | None = None,
after: Callable[[], object] | None = None,
input_text: str | None = None,
input_lines: Sequence[str] | None = None,
argv: Sequence[str] = (),
) -> Callable[[DemoFunction], DemoFunction]
Mark a function as a demo and attach its feature, hooks, and input fixtures.
Application
roadshow.app
Build and run tagged demo applications.
Roadshow
Discover tagged demos in a package and expose them through a Typer CLI.
__init__
Create a Roadshow app for one package or module.
discover
Import the package's modules and group their demos by feature tag.
start
start(
feature: Annotated[
list[str] | None,
Option(
"--feature",
"-f",
help="Features to run. Repeat this option to select multiple features; omit it to run all features.",
),
] = None,
non_interactive: Annotated[
bool,
Option(
"--non-interactive",
help="Run all selected demos without prompts.",
),
] = False,
) -> None
Run the selected demo features and report captured failures.
Rendering
roadshow.render
Render demo descriptions and captured output with Rich.
display_demo
display_demo(
function: DemoFunction,
console: Console,
*,
label: str | None = None,
input_text: str | None = None,
input_lines: Sequence[str] | None = None,
argv: Sequence[str] | None = None,
isolate_home: bool = True,
progress: tuple[int, int] | None = None,
) -> DemoResult
Display a demo and its captured result, optionally showing progress in the outer panel.