brk-code

textual の API リファレンス

textual (Textualize/textual) の公開 API 400 件 —— クラス 97、関数 83、メソッド 220。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: Textualize/textual

種別件数
クラス97
関数83
メソッド220

API 一覧

methodsrc.textual.Logger.app() -> _App | None
The associated application, or `None` if there isn't one.
methodsrc.textual.Logger.debug() -> Logger
Logs debug messages.
methodsrc.textual.Logger.error() -> Logger
Logs errors.
methodsrc.textual.Logger.event() -> Logger
Logs events.
methodsrc.textual.Logger.info() -> Logger
Logs information.
methodsrc.textual.Logger.logging() -> Logger
Logs from stdlib logging module.
methodsrc.textual.Logger.system() -> Logger
Logs system information.
methodsrc.textual.Logger.verbose() -> Logger
A verbose logger.
methodsrc.textual.Logger.verbosity(verbose:bool) -> Logger
Get a new logger with selective verbosity.
methodsrc.textual.Logger.warning() -> Logger
Logs warnings.
methodsrc.textual.Logger.worker() -> Logger
Logs worker information.
classsrc.textual.LoggerError
Raised when the logger failed.
methodsrc.textual._animator.Animation.stop(complete:bool=True) -> None
Stop the animation.
classsrc.textual._animator.AnimationError
An issue prevented animation from starting.
classsrc.textual._ansi_sequences.IgnoredSequence
Class used to mark that a sequence should be ignored.
funcsrc.textual._ansi_theme.rgb(red:int, green:int, blue:int) -> tuple[int, int, int]
Define an RGB color.
classsrc.textual._binary_encode.DecodeError
A problem decoding data.
funcsrc.textual._binary_encode.decode() -> object
Recursively decode data.
funcsrc.textual._binary_encode.decode_bytes(size_bytes:bytes) -> bytes
Decode a bytes string from the encoded data.
funcsrc.textual._binary_encode.decode_dict() -> dict[object, object]
Decode a dict.
funcsrc.textual._binary_encode.decode_int() -> int
Decode an int from the encoded data.
funcsrc.textual._binary_encode.decode_list() -> list[object]
Decode a list.
funcsrc.textual._binary_encode.decode_string() -> str
Decode a (utf-8 encoded) string from the encoded data.
funcsrc.textual._binary_encode.decode_tuple() -> tuple[object, ...]
Decode a tuple.
funcsrc.textual._binary_encode.dump(data:object) -> bytes
Encodes a data structure into bytes.
funcsrc.textual._binary_encode.encode(datum:object) -> bytes
Recursively encode data.
funcsrc.textual._binary_encode.encode_bool(datum:bool) -> bytes
Encode a boolean value.
funcsrc.textual._binary_encode.encode_bytes(datum:bytes) -> bytes
Encode a bytes value.
funcsrc.textual._binary_encode.encode_dict(datum:dict) -> bytes
Encode a dictionary value.
funcsrc.textual._binary_encode.encode_int(datum:int) -> bytes
Encode an integer value.
funcsrc.textual._binary_encode.encode_list(datum:list) -> bytes
Encode a list value.
funcsrc.textual._binary_encode.encode_none(_datum:None) -> bytes
Encodes a None value.
funcsrc.textual._binary_encode.encode_string(datum:str) -> bytes
Encode a string value.
funcsrc.textual._binary_encode.encode_tuple(datum:tuple) -> bytes
Encode a tuple value.
funcsrc.textual._binary_encode.get_byte() -> bytes
Get an encoded byte and advance position.
funcsrc.textual._binary_encode.get_bytes(size:int) -> bytes
Get a number of bytes of encode data.
funcsrc.textual._binary_encode.load(encoded:bytes) -> object
Load an encoded data structure from bytes.
funcsrc.textual._border.get_box(name:EdgeType, inner_style:Style, outer_style:Style, style:Style) -> BoxSegments
Get segments used to render a box.
funcsrc.textual._box_drawing.combine_quads(box1:Quad, box2:Quad) -> Quad
Combine two box drawing quads.
funcsrc.textual._callback.count_parameters(func:Callable) -> int
Count the number of parameters in a callable
funcsrc.textual._callback.invoke(callback:Callable[..., Any], *params:object) -> Any
Invoke a callback with an arbitrary number of parameters.
funcsrc.textual._callback.log_slow() -> None
Log a message regarding a slow callback.
classsrc.textual._compositor.ChopsUpdate
A renderable that applies updated spans to the screen.
classsrc.textual._compositor.InlineUpdate
A renderable to write an inline update.
classsrc.textual._compositor.ReflowResult
The result of a reflow operation.
funcsrc.textual._dispatch_key.dispatch_key(node:DOMNode, event:events.Key) -> bool
Dispatch a key event to method.
funcsrc.textual._doc.rich(source, language, css_class, options, md, attrs, **kwargs) -> str
A superfences formatter to insert an SVG screenshot.
classsrc.textual._duration.DurationError
Exception indicating a general issue with a CSS duration.
classsrc.textual._event_broker.HandlerArguments
Information for event handler.
classsrc.textual._event_broker.NoHandler
Raised when handler isn't found in the meta.
funcsrc.textual._event_broker.extract_handler_actions(event_name:str, meta:dict[str, Any]) -> HandlerArguments
Extract action from meta dict.
classsrc.textual._extrema.Extrema
Specifies minimum and maximum dimensions.
methodsrc.textual._extrema.Extrema.apply_dimensions(width:int, height:int) -> Size
Apply extrema to integer dimensions.
methodsrc.textual._extrema.Extrema.apply_height(height:Fraction) -> Fraction
Apply height extrema.
methodsrc.textual._extrema.Extrema.apply_width(width:Fraction) -> Fraction
Apply width extrema.
funcsrc.textual._import_app.import_app(import_name:str) -> App
Import an app from a path or import name.
funcsrc.textual._import_app.shebang_python(candidate:Path) -> bool
Does the given file look like it's run with Python?
classsrc.textual._layout_resolve.EdgeProtocol
Any object that defines an edge (such as Layout).
funcsrc.textual._loop.loop_first(values:Iterable[T]) -> Iterable[tuple[bool, T]]
Iterate and generate a tuple with a flag for first value.
funcsrc.textual._loop.loop_last(values:Iterable[T]) -> Iterable[tuple[bool, T]]
Iterate and generate a tuple with a flag for last value.
classsrc.textual._node_list.NodeList
A container for widgets that forms one level of hierarchy.
methodsrc.textual._node_list.NodeList.displayed() -> Sequence[Widget]
Just the nodes where `display==True`.
methodsrc.textual._node_list.NodeList.index(widget:Any, start:int=0, stop:int=sys.maxsize) -> int
Return the index of the given widget.
methodsrc.textual._node_list.NodeList.updated() -> None
Mark the nodes as having been updated.
classsrc.textual._node_list.ReadOnlyError
Raise if you try to mutate the list.
classsrc.textual._on.OnDecoratorError
Errors related to the `on` decorator.
classsrc.textual._on.OnNoWidget
A selector was applied to an attribute that isn't a widget.
classsrc.textual._parser.ParseEOF
End of Stream.
classsrc.textual._parser.ParseError
Base class for parse related errors.
classsrc.textual._parser.ParseTimeout
Read has timed out.
classsrc.textual._parser.Parser
Base class for a simple parser.
methodsrc.textual._parser.Parser.feed(data:str) -> Iterable[T]
Feed data to be parsed.
methodsrc.textual._parser.Parser.is_eof() -> bool
Is the parser at the end of the file (i.e.
methodsrc.textual._parser.Parser.parse(token_callback:TokenCallback) -> Generator[Read1 | Peek1, str, None]
Implement to parse a stream of text.
methodsrc.textual._parser.Parser.tick() -> Iterable[T]
Call at regular intervals to check for timeouts.
classsrc.textual._parser.Read1
Reads a single character.
funcsrc.textual._partition.partition(predicate:Callable[[T], object], iterable:Iterable[T]) -> tuple[list[T], list[T]]
Partition a sequence into two list from a given predicate.
classsrc.textual._path.CSSPathError
Raised when supplied CSS path(s) are invalid.
funcsrc.textual._profile.timer(subject:str='time', threshold:float=0) -> Generator[None, None, None]
print the elapsed time.
funcsrc.textual._resolve.resolve(dimensions:Sequence[Scalar], total:int, gutter:int, size:Size, viewport:Size, *expand:bool=False, *shrink:bool=False, *minimums:list[int] | None=None) -> list[tuple[int, int]]
Resolve a list of dimensions.
funcsrc.textual._resolve.resolve_fraction_unit(widget_styles:Iterable[RenderStyles], size:Size, viewport_size:Size, remaining_space:Fraction, resolve_dimension:Literal['width', 'height']='width') -> Fraction
Calculate the fraction.
funcsrc.textual._resolve.resolve_scalar(scalar:Scalar | None, fraction_unit:Fraction=Fraction(1)) -> Fraction | None
Resolve a scalar if it is not None.
funcsrc.textual._segment_tools.align_lines(lines:list[list[Segment]], style:Style, size:Size, horizontal:AlignHorizontal, vertical:AlignVertical) -> Iterable[list[Segment]]
Align lines.
funcsrc.textual._segment_tools.blank_lines(count:int) -> list[list[Segment]]
Create blank lines.
funcsrc.textual._segment_tools.line_crop(segments:list[Segment], start:int, end:int, total:int) -> list[Segment]
Crops a list of segments between two cell offsets.
funcsrc.textual._segment_tools.make_blank(width, style:Style) -> Segment
Make a blank segment.
classsrc.textual._slug.TrackedSlugs
Provides a class for generating tracked slugs.
methodsrc.textual._slug.TrackedSlugs.slug(text:str) -> str
Create a Markdown-friendly unique slug from the given text.
funcsrc.textual._slug.slug(text:str) -> str
Create a Markdown-friendly slug from the given text.
funcsrc.textual._slug.slug_for_tcss_id(text:str) -> str
Produce a slug usable as a TCSS id from the given text.
funcsrc.textual._styles_cache.StylesCache.line_post(segments:Iterable[Segment]) -> Iterable[Segment]
Apply effects to segments inside the border.
funcsrc.textual._styles_cache.StylesCache.post(segments:Iterable[Segment]) -> Iterable[Segment]
Post process segments to apply opacity and tint.
classsrc.textual._text_area_theme.TextAreaTheme
A theme for the `TextArea` widget.
methodsrc.textual._text_area_theme.TextAreaTheme.builtin_themes() -> list[TextAreaTheme]
Get a list of all builtin TextAreaThemes.
methodsrc.textual._text_area_theme.TextAreaTheme.get_builtin_theme(theme_name:str) -> TextAreaTheme | None
Get a `TextAreaTheme` by name.
funcsrc.textual._time.sleep(secs:float) -> None
Sleep for a given number of seconds.
classsrc.textual._two_way_dict.TwoWayDict
A two-way mapping offering O(1) access in both directions.
methodsrc.textual._two_way_dict.TwoWayDict.contains_value(value:Value) -> bool
Check if `value` is a value within this TwoWayDict.
methodsrc.textual._two_way_dict.TwoWayDict.get(key:Key) -> Value | None
Given a key, efficiently lookup and return the associated value.
methodsrc.textual._two_way_dict.TwoWayDict.get_key(value:Value) -> Key | None
Given a value, efficiently lookup and return the associated key.
funcsrc.textual._wait.wait_for_idle(min_sleep:float=SLEEP_GRANULARITY, max_sleep:float=1) -> None
Wait until the process isn't working very hard.
classsrc.textual._widget_navigation.Disableable
Non-widgets that have an enabled/disabled status.
funcsrc.textual._win_sleep.cancel()
Cancels the timer by setting the cancel event.
funcsrc.textual._win_sleep.time_sleep_coro(secs:float)
Coroutine wrapper around `time.sleep`.
classsrc.textual._work_decorator.WorkerDeclarationError
An error in the declaration of a worker method.
funcsrc.textual._work_decorator.decorated(*args:DecoratorParamSpec.args, **kwargs:DecoratorParamSpec.kwargs) -> Worker[ReturnType]
The replaced callable.
funcsrc.textual._work_decorator.decorator(method:Callable[DecoratorParamSpec, ReturnType] | Callable[DecoratorParamSpec, Coroutine[None, None, ReturnType]]) -> Callable[DecoratorParamSpec, Worker[ReturnType]]
The decorator.
funcsrc.textual._xterm_parser.XTermParser.on_key_token(event:events.Key) -> None
Token callback wrapper for handling keys.
funcsrc.textual._xterm_parser.XTermParser.on_token(token:Message) -> None
Hook to log events.
funcsrc.textual._xterm_parser.XTermParser.send_sequence(process_alt:bool=True) -> None
Send escape key and reissue sequence.
funcsrc.textual.actions.parse(action:str) -> ActionParseResult
Parses an action string.
classsrc.textual.app.ActionError
Base class for exceptions relating to actions.
classsrc.textual.app.ActiveModeError
Raised when attempting to remove the currently active mode.
classsrc.textual.app.App
The base class for Textual Applications.
methodsrc.textual.app.App.action_bell() -> None
An [action](/guide/actions) to play the terminal 'bell'.
methodsrc.textual.app.App.action_change_theme() -> None
An [action](/guide/actions) to change the current theme.
methodsrc.textual.app.App.action_command_palette() -> None
Show the Textual command palette.
methodsrc.textual.app.App.action_focus(widget_id:str) -> None
An [action](/guide/actions) to focus the given widget.
methodsrc.textual.app.App.action_focus_next() -> None
An [action](/guide/actions) to focus the next widget.
methodsrc.textual.app.App.action_help_quit() -> None
Bound to ctrl+C to alert the user that it no longer quits.
methodsrc.textual.app.App.action_hide_help_panel() -> None
Hide the keys panel (if present).
methodsrc.textual.app.App.action_notify(message:str, title:str='', severity:str='information') -> None
Show a notification.
methodsrc.textual.app.App.action_show_help_panel() -> None
Show the keys panel.
methodsrc.textual.app.App.action_simulate_key(key:str) -> None
An [action](/guide/actions) to simulate a key press.
methodsrc.textual.app.App.action_suspend_process() -> None
Suspend the process into the background.
methodsrc.textual.app.App.action_switch_mode(mode:str) -> None
An [action](/guide/actions) that switches to the given mode.
methodsrc.textual.app.App.action_switch_screen(screen:str) -> None
An [action](/guide/actions) to switch screens.
methodsrc.textual.app.App.active_bindings() -> dict[str, ActiveBinding]
Get currently active bindings.
methodsrc.textual.app.App.add_mode(mode:str, base_screen:str | Callable[[], Screen]) -> None
Adds a mode and its corresponding base screen to the app.
methodsrc.textual.app.App.animator() -> Animator
The animator object.
methodsrc.textual.app.App.ansi_theme() -> TerminalTheme
The ANSI TerminalTheme currently being used.
funcsrc.textual.app.App.app_prelude() -> bool
Work required before running the app.
funcsrc.textual.app.App.app_ready() -> None
Called by the message loop when the app is ready.
methodsrc.textual.app.App.bell() -> None
Play the console 'bell'.
methodsrc.textual.app.App.bind(keys:str, action:str, *description:str='', *show:bool=True, *key_display:str | None=None) -> None
Bind a key to an action.
methodsrc.textual.app.App.capture_mouse(widget:Widget | None) -> None
Send all mouse events to the given widget or disable mouse capture.
funcsrc.textual.app.App.check_mouse() -> None
Check if the mouse over widget has changed.
methodsrc.textual.app.App.children() -> Sequence['Widget']
A view onto the app's immediate children.
methodsrc.textual.app.App.clear_notifications() -> None
Clear all the current notifications.
methodsrc.textual.app.App.clear_selection() -> None
Clear text selection on the active screen.
methodsrc.textual.app.App.clipboard() -> str
The value of the local clipboard.
methodsrc.textual.app.App.compose() -> ComposeResult
Yield child widgets for a container.
methodsrc.textual.app.App.console_options() -> ConsoleOptions
Get options for the Rich console.
methodsrc.textual.app.App.copy_to_clipboard(text:str) -> None
Copy text to the clipboard.
methodsrc.textual.app.App.current_mode() -> str
The name of the currently active mode.
methodsrc.textual.app.App.debug() -> bool
Is debug mode enabled?
methodsrc.textual.app.App.default_screen() -> Screen
The default screen instance.
methodsrc.textual.app.App.delay_update(delay:float=0.05) -> None
Delay updates for a short period of time.
methodsrc.textual.app.App.deliver_screenshot(filename:str | None=None, path:str | None=None, time_format:str | None=None) -> str | None
Deliver a screenshot of the app.
funcsrc.textual.app.App.do_pop() -> None
Task to pop the screen.
funcsrc.textual.app.App.do_switch() -> None
Task to perform switch.
funcsrc.textual.app.App.end_batch() -> None
Re-enable updates, and refresh screen.
methodsrc.textual.app.App.end_capture_print(target:MessageTarget) -> None
End capturing of prints.
methodsrc.textual.app.App.escape_to_minimize() -> bool
Use the escape key to minimize?
methodsrc.textual.app.App.exit(result:ReturnType | None=None, return_code:int=0, message:RenderableType | None=None) -> None
Exit the app, and return the supplied result.
methodsrc.textual.app.App.export_screenshot(*title:str | None=None, *simplify:bool=False) -> str
Export an SVG screenshot of the current screen.
methodsrc.textual.app.App.format_title(title:str, sub_title:str) -> Content
Format the title for display.
methodsrc.textual.app.App.get_child_by_type(expect_type:type[ExpectType]) -> ExpectType
Get a child of a give type.
methodsrc.textual.app.App.get_css_variables() -> dict[str, str]
Get a mapping of variables used to pre-populate CSS.
methodsrc.textual.app.App.get_default_screen() -> Screen
Get the default screen.
methodsrc.textual.app.App.get_driver_class() -> Type[Driver]
Get a driver class for this platform.
methodsrc.textual.app.App.get_key_display(binding:Binding) -> str
Format a bound key for display in footer / key panel etc.
methodsrc.textual.app.App.get_line_filters() -> Sequence[LineFilter]
Get currently enabled line filters.
methodsrc.textual.app.App.get_loading_widget() -> Widget
Get a widget to be used as a loading indicator.
methodsrc.textual.app.App.get_system_commands(screen:Screen) -> Iterable[SystemCommand]
A generator of system commands used in the command palette.
methodsrc.textual.app.App.get_theme(theme_name:str) -> Theme | None
Get a theme by name.
methodsrc.textual.app.App.get_widget_at(x:int, y:int) -> tuple[Widget, Region]
Get the widget under the given coordinates.
methodsrc.textual.app.App.handle_bindings_clash(clashed_bindings:set[Binding], node:DOMNode) -> None
Handle a clash between bindings.
methodsrc.textual.app.App.install_screen(screen:Screen, name:str) -> None
Install a screen.
methodsrc.textual.app.App.is_attached() -> bool
Is this node linked to the app through the DOM?
methodsrc.textual.app.App.is_dom_root() -> bool
Is this a root node (i.e.
methodsrc.textual.app.App.is_headless() -> bool
Is the app running in 'headless' mode?
methodsrc.textual.app.App.is_inline() -> bool
Is the app running in 'inline' mode?
methodsrc.textual.app.App.is_mounted(widget:Widget) -> bool
Check if a widget is mounted.
methodsrc.textual.app.App.is_screen_installed(screen:Screen | str) -> bool
Check if a given screen has been installed.
methodsrc.textual.app.App.is_web() -> bool
Is the app running in 'web' mode via a browser?
methodsrc.textual.app.App.log() -> Logger
The textual logger.
methodsrc.textual.app.App.mount(*before:int | str | Widget | None=None, *after:int | str | Widget | None=None, *widgets:Widget) -> AwaitMount
Mount the given widgets relative to the app's screen.
methodsrc.textual.app.App.mount_all(widgets:Iterable[Widget], *before:int | str | Widget | None=None, *after:int | str | Widget | None=None) -> AwaitMount
Mount widgets from an iterable.
methodsrc.textual.app.App.native_ansi_color() -> bool
Use native ANSI colors?
methodsrc.textual.app.App.notify(message:str, *title:str='', *severity:SeverityLevel='information', *timeout:float | None=None, *markup:bool=True) -> None
Create a notification.
funcsrc.textual.app.App.on_app_ready() -> None
Called when app is ready to process events.
methodsrc.textual.app.App.open_url(url:str, *new_tab:bool=True) -> None
Open a URL in the default web browser.
methodsrc.textual.app.App.panic(*renderables:RenderableType) -> None
Exits the app and display error message(s).
funcsrc.textual.app.App.pop_screens() -> None
Pop any screens in `screens_to_pop`.
methodsrc.textual.app.App.post_display_hook() -> None
Called immediately after a display is done.
funcsrc.textual.app.App.post_mount() -> None
Called after removing children.
funcsrc.textual.app.App.press_keys(pilot:Pilot[ReturnType]) -> None
Auto press keys.
methodsrc.textual.app.App.recompose() -> None
Recompose the widget.
methodsrc.textual.app.App.refresh(*repaint:bool=True, *layout:bool=False, *recompose:bool=False) -> Self
Refresh the entire screen.
methodsrc.textual.app.App.refresh_css(animate:bool=True) -> None
Refresh CSS.
methodsrc.textual.app.App.register_theme(theme:Theme) -> None
Register a theme with the app.
methodsrc.textual.app.App.remove_mode(mode:str) -> AwaitComplete
Removes a mode from the app.
funcsrc.textual.app.App.remove_screens() -> None
Remove screens.
funcsrc.textual.app.App.render(renderable:RenderableType) -> list[Segment]
Render a panic renderables.
methodsrc.textual.app.App.return_code() -> int | None
The return code with which the app exited.
methodsrc.textual.app.App.run(*headless:bool=False, *inline:bool=False, *inline_no_clear:bool=False, *mouse:bool=True, *size:tuple[int, int] | None=None, *auto_pilot:AutopilotCallbackType | None=None, *loop:AbstractEventLoop | None=None) -> ReturnType | None
Run the app.
methodsrc.textual.app.App.run_action(action:str | ActionParseResult, default_namespace:DOMNode | None=None, namespaces:Mapping[str, DOMNode] | None=None) -> bool
Perform an [action](/guide/actions).
funcsrc.textual.app.App.run_app(app:App[ReturnType]) -> None
Run the apps message loop.
methodsrc.textual.app.App.run_async(*headless:bool=False, *inline:bool=False, *inline_no_clear:bool=False, *mouse:bool=True, *size:tuple[int, int] | None=None, *auto_pilot:AutopilotCallbackType | None=None) -> ReturnType | None
Run the app asynchronously.
funcsrc.textual.app.App.run_process_messages()
The main message loop, invoke below.
methodsrc.textual.app.App.save_screenshot(filename:str | None=None, path:str | None=None, time_format:str | None=None) -> str
Save an SVG screenshot of the current screen.
methodsrc.textual.app.App.screen() -> Screen[object]
The current active screen.
methodsrc.textual.app.App.screen_stack() -> list[Screen[Any]]
A snapshot of the current screen stack.
methodsrc.textual.app.App.search_commands(commands:Sequence[CommandListItem], placeholder:str='Search for commands…') -> AwaitMount
Show a list of commands in the app.
methodsrc.textual.app.App.set_focus(widget:Widget | None, scroll_visible:bool=True) -> None
Focus (or unfocus) a widget.
methodsrc.textual.app.App.set_keymap(keymap:Keymap) -> None
Set the keymap, a mapping of binding IDs to key strings.
methodsrc.textual.app.App.simulate_key(key:str) -> None
Simulate a key press.
methodsrc.textual.app.App.size() -> Size
The size of the terminal.
methodsrc.textual.app.App.stop_animation(attribute:str, complete:bool=True) -> None
Stop an animation on an attribute.
methodsrc.textual.app.App.suspend() -> Iterator[None]
A context manager that temporarily suspends the app.
methodsrc.textual.app.App.switch_mode(mode:str) -> AwaitMount
Switch to a given mode.
funcsrc.textual.app.App.take_screenshot() -> None
Take a screenshot and exit.
methodsrc.textual.app.App.uninstall_screen(screen:Screen | str) -> str | None
Uninstall a screen.
methodsrc.textual.app.App.unregister_theme(theme_name:str) -> None
Unregister a theme with the app.
methodsrc.textual.app.App.update_keymap(keymap:Keymap) -> None
Update the App's keymap, merging with `keymap`.
methodsrc.textual.app.App.validate_sub_title(sub_title:Any) -> str
Make sure the subtitle is set to a string.
methodsrc.textual.app.App.validate_title(title:Any) -> str
Make sure the title is set to a string.
methodsrc.textual.app.App.viewport_size() -> Size
Get the viewport size (size of the screen).
methodsrc.textual.app.App.workers() -> WorkerManager
The [worker](/guide/workers/) manager.
classsrc.textual.app.AppError
Base class for general App related exceptions.
classsrc.textual.app.InvalidModeError
Raised if there is an issue with a mode name.
classsrc.textual.app.InvalidThemeError
Raised when an invalid theme is set.
classsrc.textual.app.ModeError
Base class for exceptions related to modes.
classsrc.textual.app.ScreenError
Base class for exceptions that relate to screens.
classsrc.textual.app.ScreenStackError
Raised when trying to manipulate the screen stack incorrectly.
classsrc.textual.app.SuspendNotSupported
Raised if suspending the application is not supported.
classsrc.textual.app.UnknownModeError
Raised when attempting to use a mode that is not known.
funcsrc.textual.app.get_system_commands_provider() -> type[SystemCommandsProvider]
Callable to lazy load the system commands.
classsrc.textual.await_remove.AwaitRemove
An awaitable that waits for nodes to be removed.
funcsrc.textual.await_remove.AwaitRemove.await_prune() -> None
Wait for the prune operation to finish.
classsrc.textual.binding.Binding
The configuration of a key binding.
classsrc.textual.binding.BindingError
A binding related error.
classsrc.textual.binding.BindingsMap
Manage a set of bindings.
methodsrc.textual.binding.BindingsMap.apply_keymap(keymap:Keymap) -> KeymapApplyResult
Replace bindings for keys that are present in `keymap`.
methodsrc.textual.binding.BindingsMap.bind(keys:str, action:str, description:str='', show:bool=True, key_display:str | None=None, priority:bool=False) -> None
Bind keys to an action.
methodsrc.textual.binding.BindingsMap.copy() -> BindingsMap
Return a copy of this instance.
methodsrc.textual.binding.BindingsMap.from_keys(keys:dict[str, list[Binding]]) -> BindingsMap
Construct a BindingsMap from a dict of keys and bindings.
methodsrc.textual.binding.BindingsMap.get_bindings_for_key(key:str) -> list[Binding]
Get a list of bindings for a given key.
methodsrc.textual.binding.BindingsMap.merge(bindings:Iterable[BindingsMap]) -> BindingsMap
Merge a bindings.
methodsrc.textual.binding.BindingsMap.shown_keys() -> list[Binding]
A list of bindings for shown keys.
classsrc.textual.binding.InvalidBinding
Binding key is in an invalid format.
classsrc.textual.binding.KeymapApplyResult
The result of applying a keymap.
classsrc.textual.binding.NoBinding
A binding was not found.
classsrc.textual.box_model.BoxModel
The result of `get_box_model`.
methodsrc.textual.cache.FIFOCache.clear() -> None
Clear the cache.
methodsrc.textual.cache.FIFOCache.keys() -> KeysView[CacheKey]
Get cache keys.
methodsrc.textual.cache.FIFOCache.set(key:CacheKey, value:CacheValue) -> None
Set a value.
classsrc.textual.cache.LRUCache
A dictionary-like container with a maximum size.
methodsrc.textual.cache.LRUCache.clear() -> None
Clear the cache.
methodsrc.textual.cache.LRUCache.discard(key:CacheKey) -> None
Discard item in cache from key.
methodsrc.textual.cache.LRUCache.grow(maxsize:int) -> None
Grow the maximum size to at least `maxsize` elements.
methodsrc.textual.cache.LRUCache.keys() -> KeysView[CacheKey]
Get cache keys.
methodsrc.textual.cache.LRUCache.set(key:CacheKey, value:CacheValue) -> None
Set a value.
classsrc.textual.canvas.Canvas
A character canvas.
methodsrc.textual.canvas.Canvas.height() -> int
The canvas height.
methodsrc.textual.canvas.Canvas.render(primitives:Sequence[Primitive], base_style:Style) -> StripRenderable
Render the canvas.
methodsrc.textual.canvas.Canvas.width() -> int
The canvas width.
methodsrc.textual.canvas.Canvas.x_range(start:int, end:int) -> range
Range of x values, clipped to the canvas dimensions.
methodsrc.textual.canvas.Canvas.y_range(start:int, end:int) -> range
Range of y values, clipped to the canvas dimensions.
classsrc.textual.canvas.HorizontalLine
A horizontal line.
classsrc.textual.canvas.Primitive
Base class for a canvas primitive.
methodsrc.textual.canvas.Primitive.render(canvas:Canvas) -> None
Render to the canvas.
classsrc.textual.canvas.Rectangle
A rectangle.
classsrc.textual.canvas.VerticalLine
A vertical line.
funcsrc.textual.case.camel_to_snake(name:str, _re_snake:Pattern[str]=re.compile('[a-z][A-Z]')) -> str
Convert name from CamelCase to snake_case.
classsrc.textual.clock.Clock
An object to get relative time.
methodsrc.textual.clock.Clock.clone() -> Clock
Clone the Clock with an independent time.
methodsrc.textual.clock.Clock.reset() -> None
Reset the clock.
methodsrc.textual.clock.Clock.time() -> float
Time since creation or reset.
classsrc.textual.clock.MockClock
A mock clock object where the time may be explicitly set.
methodsrc.textual.clock.MockClock.set_time(time:float) -> None
Set the time for the clock.
methodsrc.textual.clock.MockClock.time() -> float
Time since creation or reset.
classsrc.textual.color.Color
A class to represent a color.
methodsrc.textual.color.Color.automatic(alpha_percentage:float=100.0) -> Color
Create an automatic color.
methodsrc.textual.color.Color.blend(destination:Color, factor:float, alpha:float | None=None) -> Color
Generate a new color between two colors.
methodsrc.textual.color.Color.brightness() -> float
The human perceptual brightness.
methodsrc.textual.color.Color.css() -> str
The color in CSS RGB or RGBA form.
methodsrc.textual.color.Color.darken(amount:float, alpha:float | None=None) -> Color
Darken the color by a given amount.
methodsrc.textual.color.Color.from_hsl(h:float, s:float, l:float) -> Color
Create a color from HSL components.
methodsrc.textual.color.Color.from_hsv(h:float, s:float, v:float) -> Color
Create a color from HSV components.
methodsrc.textual.color.Color.from_rich_color(rich_color:RichColor | None, theme:TerminalTheme | None=None, foreground:bool=True, ansi:bool=True) -> Color
Create a new color from Rich's Color class.
methodsrc.textual.color.Color.get_contrast_text(alpha:float=0.95) -> Color
Get a light or dark color that best contrasts this color, for use with text.
methodsrc.textual.color.Color.hex6() -> str
The color in CSS hex form, with 6 digits for RGB.
methodsrc.textual.color.Color.hsl() -> HSL
This color in HSL format.
methodsrc.textual.color.Color.hsv() -> HSV
This color in HSV format.
methodsrc.textual.color.Color.inverse() -> Color
The inverse of this color.
methodsrc.textual.color.Color.is_transparent() -> bool
Is the color transparent (i.e.
methodsrc.textual.color.Color.lighten(amount:float, alpha:float | None=None) -> Color
Lighten the color by a given amount.
methodsrc.textual.color.Color.monochrome() -> Color
A monochrome version of this color.
methodsrc.textual.color.Color.multiply_alpha(alpha:float) -> Color
Create a new color, multiplying the alpha by a constant.
methodsrc.textual.color.Color.parse(color_text:str | Color) -> Color
Parse a string containing a named color or CSS-style color.
methodsrc.textual.color.Color.rich_color() -> RichColor
This color encoded in Rich's Color class.
methodsrc.textual.color.Color.tint(color:Color) -> Color
Apply a tint to a color.
methodsrc.textual.color.Color.with_alpha(alpha:float) -> Color
Create a new color with the given alpha.
classsrc.textual.color.ColorParseError
A color failed to parse.
classsrc.textual.color.Gradient
Defines a color gradient.
methodsrc.textual.color.Gradient.colors() -> list[Color]
A list of colors in the gradient.
methodsrc.textual.color.Gradient.get_color(position:float) -> Color
Get a color from the gradient at a position between 0 and 1.
classsrc.textual.color.HSL
A color in HSL (Hue, Saturation, Lightness) format.
funcsrc.textual.color.HSL.as_str(number:float) -> str
Format a float.
methodsrc.textual.color.HSL.css() -> str
HSL in css format.
classsrc.textual.color.HSV
A color in HSV (Hue, Saturation, Value) format.
classsrc.textual.color.Lab
A color in CIE-L*ab format.
funcsrc.textual.color.lab_to_rgb(lab:Lab, alpha:float=1.0) -> Color
Convert a CIE-L*ab color to RGB.
funcsrc.textual.color.rgb_to_lab(rgb:Color) -> Lab
Convert an RGB color to the CIE-L*ab format.
classsrc.textual.command.CommandInput
The command palette input control.
classsrc.textual.command.CommandList
The command palette command list.
classsrc.textual.command.CommandPalette
The Textual command palette.
classsrc.textual.command.CommandPalette.Closed
Posted to App when the command palette is closed.
classsrc.textual.command.CommandPalette.Opened
Posted to App when the command palette is opened.
funcsrc.textual.command.CommandPalette.build_prompt() -> Iterable[Content]
Generator for prompt content.
methodsrc.textual.command.CommandPalette.compose() -> ComposeResult
Compose the command palette.
methodsrc.textual.command.CommandPalette.is_open(app:App[object]) -> bool
Is a command palette current open?
classsrc.textual.command.DiscoveryHit
Holds the details of a single command search hit.
methodsrc.textual.command.DiscoveryHit.score() -> float
A discovery hit always has a score of 0.
classsrc.textual.command.Hit
Holds the details of a single command search hit.
classsrc.textual.command.Provider
Base class for command palette command providers.
methodsrc.textual.command.Provider.app() -> App[object]
A reference to the application.
methodsrc.textual.command.Provider.discover() -> Hits
A default collection of hits for the provider.
funcsrc.textual.command.Provider.post_init_task() -> None
Wrapper to post init that runs in a task.
methodsrc.textual.command.Provider.screen() -> Screen[object]
The currently-active screen in the application.
methodsrc.textual.command.Provider.search(query:str) -> Hits
A request to search for commands relevant to the given query.
methodsrc.textual.command.Provider.shutdown() -> None
Called when the Provider is shutdown.
classsrc.textual.command.SearchIcon
Widget for displaying a search icon before the command input.
methodsrc.textual.command.SearchIcon.render() -> VisualType
Render the icon.
classsrc.textual.command.SimpleCommand
A simple command.
classsrc.textual.command.SimpleProvider
A simple provider which the caller can pass commands to.
classsrc.textual.containers.Center
A container which aligns children on the X axis.
classsrc.textual.containers.CenterMiddle
A container which aligns its children on both axis.
classsrc.textual.containers.Container
Simple container widget, with vertical layout.
classsrc.textual.containers.Grid
A container with grid layout.
classsrc.textual.containers.ItemGrid
A container with grid layout and automatic columns.
classsrc.textual.containers.Middle
A container which aligns children on the Y axis.
classsrc.textual.containers.Right
A container which aligns children on the X axis.
classsrc.textual.containers.Vertical
An expanding container with vertical layout and no scrollbars.
classsrc.textual.content.Content
Text content with marked up spans.
methodsrc.textual.content.Content.add_spans(spans:Sequence[Span]) -> Content
Adds spans to this Content instance.
methodsrc.textual.content.Content.append(content:Content | str) -> Content
Append text or content to this content.
methodsrc.textual.content.Content.append_text(text:str, style:Style | str='') -> Content
Append text give as a string, with an optional style.
methodsrc.textual.content.Content.blank(width:int, style:Style | str | None=None) -> Content
Get a Content instance consisting of spaces.
methodsrc.textual.content.Content.cell_length() -> int
The cell length of the content.
methodsrc.textual.content.Content.center(width:int, ellipsis:bool=False) -> Content
Align a line to the center.
methodsrc.textual.content.Content.divide(offsets:Sequence[int]) -> list[Content]
Divide the content at the given offsets.
methodsrc.textual.content.Content.empty() -> Content
Get an empty (blank) content
methodsrc.textual.content.Content.expand_tabs(tab_size:int=8) -> Content
Converts tabs to spaces.
methodsrc.textual.content.Content.first_line() -> Content
The first line of the content.
methodsrc.textual.content.Content.from_markup(markup:str | Content, **variables:object) -> Content
Create content from markup, optionally combined with template variables.
methodsrc.textual.content.Content.from_rich_text(text:str | Text, console:Console | None=None) -> Content
Create equivalent Visual Content for str or Text.
methodsrc.textual.content.Content.from_text(markup_content_or_text:ContentText, markup:bool=True) -> Content
Construct content from Text or str.
funcsrc.textual.content.Content.get_current_style() -> Style
Construct current style from stack.
methodsrc.textual.content.Content.get_height(rules:RulesMap, width:int) -> int
Get the height of the Visual if rendered at the given width.
methodsrc.textual.content.Content.get_minimal_width(rules:RulesMap) -> int
Minimal width is the largest single word.
methodsrc.textual.content.Content.get_optimal_width(rules:RulesMap, container_width:int) -> int
Get optimal width of the Visual to display its content.
methodsrc.textual.content.Content.get_style_at_offset(offset:int) -> Style
Get the style of a character at give offset.
methodsrc.textual.content.Content.is_same(content:Content) -> bool
Compare to another Content object.
funcsrc.textual.content.Content.iter_content() -> Iterable[Content]
Iterate the lines, optionally inserting the separator.
methodsrc.textual.content.Content.join(lines:Iterable[Content | str]) -> Content
Join an iterable of content or strings.
methodsrc.textual.content.Content.pad(left:int, right:int, character:str=' ') -> Content
Pad both the left and right edges with a given number of characters.
methodsrc.textual.content.Content.pad_left(count:int, character:str=' ') -> Content
Pad the left with a given character.
methodsrc.textual.content.Content.pad_right(count:int, character:str=' ') -> Content
Pad the right with a given character.
methodsrc.textual.content.Content.plain() -> str
Get the text as a single string.
methodsrc.textual.content.Content.render_segments(base_style:Style=Style.null(), end:str='') -> list[Segment]
Render the Content in to a list of segments.
methodsrc.textual.content.Content.render_strips(width:int, height:int | None, style:Style, options:RenderOptions) -> list[Strip]
Render the Visual into an iterable of strips.
methodsrc.textual.content.Content.right(width:int, ellipsis:bool=False) -> Content
Align a line to the right.
methodsrc.textual.content.Content.right_crop(amount:int=1) -> Content
Remove a number of characters from the end of the text.
methodsrc.textual.content.Content.rstrip(chars:str | None=None) -> Content
Strip characters from end of text.
methodsrc.textual.content.Content.rstrip_end(size:int) -> Content
Remove whitespace beyond a certain width at the end of the text.
methodsrc.textual.content.Content.simplify() -> Content
Simplify spans by joining contiguous spans together.
methodsrc.textual.content.Content.split(separator:str='\n', *include_separator:bool=False, *allow_blank:bool=False) -> list[Content]
Split rich text into lines, preserving styles.
methodsrc.textual.content.Content.stylize(style:Style | str, start:int=0, end:int | None=None) -> Content
Apply a style to the text, or a portion of the text.
methodsrc.textual.content.Content.stylize_before(style:Style | str, start:int=0, end:int | None=None) -> Content
Apply a style to the text, or a portion of the text.
methodsrc.textual.content.Content.truncate(max_width:int, *ellipsis=False, *pad:bool=False) -> Content
Truncate the content at a given cell width.
methodsrc.textual.content.Content.without_spans() -> Content
The content with no spans
methodsrc.textual.content.Content.wrap(width:int, *align:TextAlign='left', *overflow:TextOverflow='fold') -> list[Content]
Wrap text so that it fits within the given dimensions.
classsrc.textual.content.Span
A style applied to a range of character offsets.
methodsrc.textual.content.Span.extend(cells:int) -> 'Span'
Extend the span by the given number of cells.
classsrc.textual.coordinate.Coordinate
An object representing a row/column coordinate within a grid.
methodsrc.textual.coordinate.Coordinate.down() -> Coordinate
Get the coordinate below.
methodsrc.textual.coordinate.Coordinate.left() -> Coordinate
Get the coordinate to the left.
methodsrc.textual.coordinate.Coordinate.right() -> Coordinate
Get the coordinate to the right.
methodsrc.textual.coordinate.Coordinate.up() -> Coordinate
Get the coordinate above.
funcsrc.textual.css._error_tools.friendly_list(words:Iterable[str], joiner:str='or', omit_empty:bool=True) -> str
Generate a list of words as readable prose.
classsrc.textual.css._style_properties.BooleanProperty
A property that requires a True or False value.
funcsrc.textual.css._style_properties.BorderProperty.check_refresh() -> None
Check if an update requires a layout
classsrc.textual.css._style_properties.ColorProperty
Descriptor for getting and setting color properties.
classsrc.textual.css._style_properties.DockProperty
Descriptor for getting and setting the dock property.
classsrc.textual.css._style_properties.Edges
Stores edges for border / outline.
methodsrc.textual.css._style_properties.Edges.spacing() -> Spacing
Get spacing created by borders.
classsrc.textual.css._style_properties.FractionalProperty
Property that can be set either as a float (e.g.
classsrc.textual.css._style_properties.HatchProperty
Property to expose hatch style.
classsrc.textual.css._style_properties.KeylineProperty
Descriptor for getting and setting keyline information.
classsrc.textual.css._style_properties.LayoutProperty
Descriptor for getting and setting layout.
classsrc.textual.css._style_properties.NameProperty
Descriptor for getting and setting name properties.
classsrc.textual.css._style_properties.OffsetProperty
Descriptor for getting and setting the offset property.
classsrc.textual.css._style_properties.ScalarListProperty
Descriptor for lists of scalars.
classsrc.textual.css._style_properties.ScalarProperty
Descriptor for getting and setting scalar properties.
classsrc.textual.css._style_properties.ScrollbarColorProperty
A descriptor to set scrollbar color(s).
classsrc.textual.css._style_properties.SplitProperty
Descriptor for getting and setting the split property.
classsrc.textual.css._style_properties.TransitionsProperty
Descriptor for getting transitions properties

この情報について

掲載しているシグネチャは Textualize/textual の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る