TUI
Terminal user interface (TUI) helper functions and components.
diff2rich(diff, *, console=Console())
Show rich representation of notebook diff in terminal.
Source code in databooks/tui.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
diffs2rich(diffs, *, context=False, export_kwargs=None, **console_kwargs)
diffs2rich(
diffs: List[DiffContents],
*,
context: ImgFmt,
**kwargs: Any,
) -> str
diffs2rich(
diffs: List[DiffContents],
*,
context: bool,
**kwargs: Any,
) -> None
Show rich representation of notebook diff in terminal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diffs
|
List[DiffContents]
|
|
required |
context
|
Union[ImgFmt, bool]
|
specify context - |
False
|
export_kwargs
|
Optional[Dict[str, Any]]
|
keyword arguments for exporting prints (as a dictionary) |
None
|
console_kwargs
|
Any
|
keyword arguments to be passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
console output if |
Source code in databooks/tui.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
nb2rich(path, console=Console())
Show rich representation of notebook in terminal.
Source code in databooks/tui.py
23 24 25 26 27 28 29 | |
nbs2rich(paths, *, context=False, export_kwargs=None, **console_kwargs)
nbs2rich(
paths: List[Path], *, context: ImgFmt, **kwargs: Any
) -> str
nbs2rich(
paths: List[Path], *, context: bool, **kwargs: Any
) -> None
Show rich representation of notebooks in terminal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
List[Path]
|
notebook paths to print |
required |
context
|
Union[ImgFmt, bool]
|
specify context - |
False
|
export_kwargs
|
Optional[Dict[str, Any]]
|
keyword arguments for exporting prints (as a dictionary) |
None
|
console_kwargs
|
Any
|
keyword arguments to be passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
console output if |
Source code in databooks/tui.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |