Skip to content

omnipy.shared.enums.ui

CLASS DESCRIPTION
AutoDetectableUserInterfaceType

User interface types that can be automatically detected by Omnipy, based

BrowserPageUserInterfaceType
BrowserTagUserInterfaceType
BrowserUserInterfaceType
HtmlPageOutputUserInterfaceType
HtmlTagOutputUserInterfaceType
IpythonEmbeddedTerminalUserInterfaceType
IpythonTerminalUserInterfaceType
JupyterEmbeddedUserInterfaceType
JupyterInBrowserUserInterfaceType
JupyterUserInterfaceType
PlainTerminalEmbeddedUserInterfaceType
PlainTerminalUserInterfaceType
RgbColorUserInterfaceType
SpecifiedUserInterfaceType

User interface types that are specified as a particular UI type, either

SupportsDarkTerminalBgDetection
TerminalOutputUserInterfaceType
TerminalUserInterfaceType
UserInterfaceType

Describes the type of interface in use for interacting with the user,

AutoDetectableUserInterfaceType

Bases: PlainTerminalUserInterfaceType, IpythonTerminalUserInterfaceType, JupyterUserInterfaceType

User interface types that can be automatically detected by Omnipy, based on the environment in which the code is running.

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class AutoDetectableUserInterfaceType(
        PlainTerminalUserInterfaceType,
        IpythonTerminalUserInterfaceType,
        JupyterUserInterfaceType,
):
    """
    User interface types that can be automatically detected by Omnipy, based
    on the environment in which the code is running.
    """

    Literals = Literal[
        PlainTerminalUserInterfaceType.Literals,
        IpythonTerminalUserInterfaceType.Literals,
        JupyterUserInterfaceType.Literals,
    ]

Literals class-attribute instance-attribute

BrowserPageUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
BROWSER_PAGE

TYPE: Literal['browser-page']

Literals

Source code in src/omnipy/shared/enums/ui.py
class BrowserPageUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['browser-page']

    BROWSER_PAGE: Literal['browser-page'] = 'browser-page'
    f"""
    {_BROWSER_DESCRIPTION} The `BROWSER_PAGE` UI type displays content as
    full web pages.
    """

BROWSER_PAGE class-attribute instance-attribute

BROWSER_PAGE: Literal['browser-page'] = 'browser-page'

Literals class-attribute instance-attribute

Literals = Literal['browser-page']

BrowserTagUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
BROWSER_TAG

TYPE: Literal['browser-tag']

Literals

Source code in src/omnipy/shared/enums/ui.py
class BrowserTagUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['browser-tag']

    BROWSER_TAG: Literal['browser-tag'] = 'browser-tag'
    f"""
    {_BROWSER_DESCRIPTION} The `BROWSER_TAG` UI type displays content as
    standalone HTML elements, for HTML code that can be embedded in other
    HTML documents.
    """

BROWSER_TAG class-attribute instance-attribute

BROWSER_TAG: Literal['browser-tag'] = 'browser-tag'

Literals class-attribute instance-attribute

Literals = Literal['browser-tag']

BrowserUserInterfaceType

Bases: BrowserPageUserInterfaceType, BrowserTagUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class BrowserUserInterfaceType(BrowserPageUserInterfaceType, BrowserTagUserInterfaceType):
    Literals = Literal[BrowserPageUserInterfaceType.Literals, BrowserTagUserInterfaceType.Literals]

Literals class-attribute instance-attribute

HtmlPageOutputUserInterfaceType

Bases: BrowserPageUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class HtmlPageOutputUserInterfaceType(BrowserPageUserInterfaceType):
    Literals = Literal[BrowserPageUserInterfaceType.Literals]

Literals class-attribute instance-attribute

HtmlTagOutputUserInterfaceType

Bases: JupyterInBrowserUserInterfaceType, BrowserTagUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class HtmlTagOutputUserInterfaceType(
        JupyterInBrowserUserInterfaceType,
        BrowserTagUserInterfaceType,
):
    Literals = Literal[
        JupyterInBrowserUserInterfaceType.Literals,
        BrowserTagUserInterfaceType.Literals,
    ]

Literals class-attribute instance-attribute

IpythonEmbeddedTerminalUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
Literals

PYCHARM_IPYTHON

TYPE: Literal['pycharm_ipython']

Source code in src/omnipy/shared/enums/ui.py
class IpythonEmbeddedTerminalUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['pycharm_ipython']

    PYCHARM_IPYTHON: Literal['pycharm_ipython'] = 'pycharm_ipython'
    f"""
    The console and/or terminal of the JetBrains PyCharm IDE running with
    the IPython interactive interpreter (REPL).
     {_IPYTHON_DESCRIPTION} {_PYCHARM_NOTE}
    """

Literals class-attribute instance-attribute

Literals = Literal['pycharm_ipython']

PYCHARM_IPYTHON class-attribute instance-attribute

PYCHARM_IPYTHON: Literal['pycharm_ipython'] = 'pycharm_ipython'

IpythonTerminalUserInterfaceType

Bases: IpythonEmbeddedTerminalUserInterfaceType, LiteralEnum[str]

ATTRIBUTE DESCRIPTION
IPYTHON

Same as TERMINAL, but running within the IPython interactive

TYPE: Literal['ipython']

Literals

Source code in src/omnipy/shared/enums/ui.py
class IpythonTerminalUserInterfaceType(IpythonEmbeddedTerminalUserInterfaceType, LiteralEnum[str]):
    Literals = Literal['ipython', IpythonEmbeddedTerminalUserInterfaceType.Literals]

    IPYTHON: Literal['ipython'] = 'ipython'
    """
    Same as `TERMINAL`, but running within the IPython interactive
    interpreter (REPL). The IPython interpreter is a more advanced
    interactive interpreter that provides additional features such as syntax
    highlighting, tab completion, and better error messages.
    """

IPYTHON class-attribute instance-attribute

IPYTHON: Literal['ipython'] = 'ipython'

Same as TERMINAL, but running within the IPython interactive interpreter (REPL). The IPython interpreter is a more advanced interactive interpreter that provides additional features such as syntax highlighting, tab completion, and better error messages.

Literals class-attribute instance-attribute

Literals = Literal['ipython', IpythonEmbeddedTerminalUserInterfaceType.Literals]

JupyterEmbeddedUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
Literals

PYCHARM_JUPYTER

TYPE: Literal['pycharm_jupyter']

Source code in src/omnipy/shared/enums/ui.py
class JupyterEmbeddedUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['pycharm_jupyter']

    PYCHARM_JUPYTER: Literal['pycharm_jupyter'] = 'pycharm_jupyter'
    f"""
    A Jupyter notebook running within the user interface of the JetBrains
    PyCharm IDE.
     {_JUPYTER_DESCRIPTION} {_PYCHARM_NOTE}.
    """

Literals class-attribute instance-attribute

Literals = Literal['pycharm_jupyter']

PYCHARM_JUPYTER class-attribute instance-attribute

PYCHARM_JUPYTER: Literal['pycharm_jupyter'] = 'pycharm_jupyter'

JupyterInBrowserUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
JUPYTER

TYPE: Literal['jupyter']

Literals

Source code in src/omnipy/shared/enums/ui.py
class JupyterInBrowserUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['jupyter']

    JUPYTER: Literal['jupyter'] = 'jupyter'
    f"""
    A Jupyter notebook or JupyterLab environment opened from a web browser.
     {_JUPYTER_DESCRIPTION}
    """

JUPYTER class-attribute instance-attribute

JUPYTER: Literal['jupyter'] = 'jupyter'

Literals class-attribute instance-attribute

Literals = Literal['jupyter']

JupyterUserInterfaceType

Bases: JupyterEmbeddedUserInterfaceType, JupyterInBrowserUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class JupyterUserInterfaceType(
        JupyterEmbeddedUserInterfaceType,
        JupyterInBrowserUserInterfaceType,
):
    Literals = Literal[
        JupyterEmbeddedUserInterfaceType.Literals,
        JupyterInBrowserUserInterfaceType.Literals,
    ]

Literals class-attribute instance-attribute

PlainTerminalEmbeddedUserInterfaceType

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
Literals

PYCHARM_TERMINAL

TYPE: Literal['pycharm_terminal']

Source code in src/omnipy/shared/enums/ui.py
class PlainTerminalEmbeddedUserInterfaceType(LiteralEnum[str]):
    Literals = Literal['pycharm_terminal']

    PYCHARM_TERMINAL: Literal['pycharm_terminal'] = 'pycharm_terminal'
    f"""
    The console and/or terminal of the JetBrains PyCharm IDE running with
    the Python interactive interpreter (REPL). {_PYCHARM_NOTE}
    """

Literals class-attribute instance-attribute

Literals = Literal['pycharm_terminal']

PYCHARM_TERMINAL class-attribute instance-attribute

PYCHARM_TERMINAL: Literal['pycharm_terminal'] = 'pycharm_terminal'

PlainTerminalUserInterfaceType

Bases: PlainTerminalEmbeddedUserInterfaceType, LiteralEnum[str]

ATTRIBUTE DESCRIPTION
Literals

TERMINAL

A standard Python interactive interpreter (REPL), running within

TYPE: Literal['terminal']

UNKNOWN

The UNKNOWN user interface type is used when the user interface type

TYPE: Literal['unknown']

Source code in src/omnipy/shared/enums/ui.py
class PlainTerminalUserInterfaceType(PlainTerminalEmbeddedUserInterfaceType, LiteralEnum[str]):
    Literals = Literal['terminal', PlainTerminalEmbeddedUserInterfaceType.Literals, 'unknown']

    TERMINAL: Literal['terminal'] = 'terminal'
    """
    A standard Python interactive interpreter (REPL), running within
    terminal-emulation software, such as the builtin "Terminal" app on Mac
    OS or GNOME Terminal on Linux, through a SSH connection to a remote
    server,  or directly on a console.
    """

    UNKNOWN: Literal['unknown'] = 'unknown'
    """
    The `UNKNOWN` user interface type is used when the user interface type
    cannot be determined. This will in practice produce the same output as
    for the `TERMINAL` display type. As is default for terminals, we try
    to autodetect color capabilities such as ANSI escape codes for color
    and text formatting (see `DisplayColorSystem.AUTO`).
    """

Literals class-attribute instance-attribute

Literals = Literal['terminal', PlainTerminalEmbeddedUserInterfaceType.Literals, 'unknown']

TERMINAL class-attribute instance-attribute

TERMINAL: Literal['terminal'] = 'terminal'

A standard Python interactive interpreter (REPL), running within terminal-emulation software, such as the builtin "Terminal" app on Mac OS or GNOME Terminal on Linux, through a SSH connection to a remote server, or directly on a console.

UNKNOWN class-attribute instance-attribute

UNKNOWN: Literal['unknown'] = 'unknown'

The UNKNOWN user interface type is used when the user interface type cannot be determined. This will in practice produce the same output as for the TERMINAL display type. As is default for terminals, we try to autodetect color capabilities such as ANSI escape codes for color and text formatting (see DisplayColorSystem.AUTO).

RgbColorUserInterfaceType

Bases: PlainTerminalEmbeddedUserInterfaceType, IpythonEmbeddedTerminalUserInterfaceType, JupyterUserInterfaceType, BrowserUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class RgbColorUserInterfaceType(PlainTerminalEmbeddedUserInterfaceType,
                                IpythonEmbeddedTerminalUserInterfaceType,
                                JupyterUserInterfaceType,
                                BrowserUserInterfaceType):
    Literals = Literal[
        PlainTerminalEmbeddedUserInterfaceType.Literals,
        IpythonEmbeddedTerminalUserInterfaceType.Literals,
        JupyterUserInterfaceType.Literals,
        BrowserUserInterfaceType.Literals,
    ]

SpecifiedUserInterfaceType

Bases: PlainTerminalUserInterfaceType, IpythonTerminalUserInterfaceType, JupyterUserInterfaceType, BrowserUserInterfaceType

User interface types that are specified as a particular UI type, either automatically determined by Omnipy or hard-coded (i.e. for browser output). This is a union of all supported user interface types (including UNKNOWN), except for AUTO.

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class SpecifiedUserInterfaceType(PlainTerminalUserInterfaceType,
                                 IpythonTerminalUserInterfaceType,
                                 JupyterUserInterfaceType,
                                 BrowserUserInterfaceType):
    """
    User interface types that are specified as a particular UI type, either
    automatically determined by Omnipy or hard-coded (i.e. for browser
    output). This is a union of all supported user interface types
    (including `UNKNOWN`), except for `AUTO`.
    """

    Literals = Literal[
        PlainTerminalUserInterfaceType.Literals,
        IpythonTerminalUserInterfaceType.Literals,
        JupyterUserInterfaceType.Literals,
        BrowserUserInterfaceType.Literals,
    ]

SupportsDarkTerminalBgDetection

Bases: TerminalUserInterfaceType, JupyterEmbeddedUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class SupportsDarkTerminalBgDetection(TerminalUserInterfaceType, JupyterEmbeddedUserInterfaceType):
    Literals = Literal[
        TerminalUserInterfaceType.Literals,
        JupyterEmbeddedUserInterfaceType.Literals,
    ]

Literals class-attribute instance-attribute

TerminalOutputUserInterfaceType

Bases: PlainTerminalUserInterfaceType, IpythonTerminalUserInterfaceType, JupyterEmbeddedUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class TerminalOutputUserInterfaceType(
        PlainTerminalUserInterfaceType,
        IpythonTerminalUserInterfaceType,
        JupyterEmbeddedUserInterfaceType,
):
    Literals = Literal[
        PlainTerminalUserInterfaceType.Literals,
        IpythonTerminalUserInterfaceType.Literals,
        JupyterEmbeddedUserInterfaceType.Literals,
    ]

TerminalUserInterfaceType

Bases: PlainTerminalUserInterfaceType, IpythonTerminalUserInterfaceType

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/ui.py
class TerminalUserInterfaceType(PlainTerminalUserInterfaceType, IpythonTerminalUserInterfaceType):
    Literals = Literal[
        PlainTerminalUserInterfaceType.Literals,
        IpythonTerminalUserInterfaceType.Literals,
    ]

Literals class-attribute instance-attribute

UserInterfaceType

Bases: SpecifiedUserInterfaceType, LiteralEnum[str]

Describes the type of interface in use for interacting with the user, encompassing the support available for displaying output as well as how the user interacts with the library (including the type of interactive interpreter used, if any).

Should be automatically determined by Omnipy, but the user can also be set the user interface type manually in the config if for some reason needed (e.g. if auto-detection fails). In particular, the user can expect this to fail in other IDEs than PyCharm, which is the only IDE currently supported by Omnipy.

METHOD DESCRIPTION
is_browser
is_ipython_terminal
is_jupyter
is_jupyter_embedded
is_jupyter_in_browser
is_plain_terminal
is_terminal
requires_html_page_output
requires_html_tag_output
requires_terminal_output
supports_dark_terminal_bg_detection
supports_rgb_color_output
ATTRIBUTE DESCRIPTION
AUTO

The AUTO user interface type is used to describe that the user

TYPE: Literal['auto']

Literals

Source code in src/omnipy/shared/enums/ui.py
class UserInterfaceType(SpecifiedUserInterfaceType, LiteralEnum[str]):
    """
    Describes the type of interface in use for interacting with the user,
    encompassing the support available for displaying output as well as how
    the user interacts with the library (including the type of interactive
    interpreter used, if any).

    Should be automatically determined by Omnipy, but the user can also be
    set the user interface type manually in the config if for some reason
    needed (e.g. if auto-detection fails). In particular, the user can
    expect this to fail in other IDEs than PyCharm, which is the only IDE
    currently supported by Omnipy.
    """

    Literals = Literal[SpecifiedUserInterfaceType.Literals, 'auto']

    AUTO: Literal['auto'] = 'auto'
    """
    The `AUTO` user interface type is used to describe that the user
    interface type has not yet been determined, and that it should be
    automatically determined by Omnipy. This is the default value.
    """
    @classmethod
    def is_plain_terminal(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[PlainTerminalUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any plain
        (non-IPython) terminal UI types. {_UNKNOWN_NOTE} {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in PlainTerminalUserInterfaceType

    @classmethod
    def is_ipython_terminal(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[IpythonTerminalUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to an IPython
        interactive interpreter (REPL). {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in IpythonTerminalUserInterfaceType

    @classmethod
    def is_terminal(
            cls,
            ui_type: 'UserInterfaceType.Literals') -> TypeIs[TerminalUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any type of terminal
        UI types, including IPython and plain terminal.
         {_UNKNOWN_NOTE} {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in TerminalUserInterfaceType

    @classmethod
    def is_jupyter_embedded(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[JupyterEmbeddedUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to a Jupyter notebook
        embedded within other software, such as an IDE.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in JupyterEmbeddedUserInterfaceType

    @classmethod
    def supports_dark_terminal_bg_detection(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[SupportsDarkTerminalBgDetection.Literals]:
        f"""
        Check whether the user interface type supports detection of dark
        background color by checking environment variables or using
        ANSI terminal functionality. This is typically the case for
        Jupyter notebooks embedded in IDEs, such as PyCharm, or other
        terminals.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in SupportsDarkTerminalBgDetection

    @classmethod
    def is_jupyter_in_browser(
        cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[JupyterInBrowserUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to a Jupyter notebook
        or JupyterLab environment opened from a web browser.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in JupyterInBrowserUserInterfaceType

    @classmethod
    def is_jupyter(
            cls,
            ui_type: 'UserInterfaceType.Literals') -> TypeIs[JupyterUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to a Jupyter notebook
        or JupyterLab environment in any context.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in JupyterUserInterfaceType

    @classmethod
    def is_browser(
            cls,
            ui_type: 'UserInterfaceType.Literals') -> TypeIs[BrowserUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to a web browser.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in BrowserUserInterfaceType

    @classmethod
    def supports_rgb_color_output(
            cls,
            ui_type: 'UserInterfaceType.Literals') -> TypeIs[RgbColorUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any UI types that
        support RGB color output.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in RgbColorUserInterfaceType

    @classmethod
    def requires_terminal_output(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[TerminalOutputUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any UI types that
        require output with ANSI terminal encoding for colors and styles. If
        user interface type is unknown, we assume it is a terminal and try
        to autodetect color capabilities, as default for terminals (see
        `DisplayColorSystem.AUTO`).
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in TerminalOutputUserInterfaceType

    @classmethod
    def requires_html_tag_output(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[HtmlTagOutputUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any UI types that
        require output as self-contained HTML tags for embedding in other
        HTML pages.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in HtmlTagOutputUserInterfaceType

    @classmethod
    def requires_html_page_output(
            cls, ui_type: 'UserInterfaceType.Literals'
    ) -> TypeIs[HtmlPageOutputUserInterfaceType.Literals]:
        f"""
        Check whether the user interface type refers to any UI types that
        require output as a full HTML page.
         {_TYPEIS_NARROW_NOTE}
        """
        return ui_type in HtmlPageOutputUserInterfaceType

AUTO class-attribute instance-attribute

AUTO: Literal['auto'] = 'auto'

The AUTO user interface type is used to describe that the user interface type has not yet been determined, and that it should be automatically determined by Omnipy. This is the default value.

Literals class-attribute instance-attribute

Literals = Literal[SpecifiedUserInterfaceType.Literals, 'auto']

is_browser classmethod

Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_browser(
        cls,
        ui_type: 'UserInterfaceType.Literals') -> TypeIs[BrowserUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to a web browser.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in BrowserUserInterfaceType

is_ipython_terminal classmethod

is_ipython_terminal(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[IpythonTerminalUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_ipython_terminal(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[IpythonTerminalUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to an IPython
    interactive interpreter (REPL). {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in IpythonTerminalUserInterfaceType

is_jupyter classmethod

Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_jupyter(
        cls,
        ui_type: 'UserInterfaceType.Literals') -> TypeIs[JupyterUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to a Jupyter notebook
    or JupyterLab environment in any context.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in JupyterUserInterfaceType

is_jupyter_embedded classmethod

is_jupyter_embedded(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[JupyterEmbeddedUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_jupyter_embedded(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[JupyterEmbeddedUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to a Jupyter notebook
    embedded within other software, such as an IDE.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in JupyterEmbeddedUserInterfaceType

is_jupyter_in_browser classmethod

is_jupyter_in_browser(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[JupyterInBrowserUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_jupyter_in_browser(
    cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[JupyterInBrowserUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to a Jupyter notebook
    or JupyterLab environment opened from a web browser.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in JupyterInBrowserUserInterfaceType

is_plain_terminal classmethod

is_plain_terminal(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[PlainTerminalUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_plain_terminal(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[PlainTerminalUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any plain
    (non-IPython) terminal UI types. {_UNKNOWN_NOTE} {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in PlainTerminalUserInterfaceType

is_terminal classmethod

Source code in src/omnipy/shared/enums/ui.py
@classmethod
def is_terminal(
        cls,
        ui_type: 'UserInterfaceType.Literals') -> TypeIs[TerminalUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any type of terminal
    UI types, including IPython and plain terminal.
     {_UNKNOWN_NOTE} {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in TerminalUserInterfaceType

requires_html_page_output classmethod

requires_html_page_output(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[HtmlPageOutputUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def requires_html_page_output(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[HtmlPageOutputUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any UI types that
    require output as a full HTML page.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in HtmlPageOutputUserInterfaceType

requires_html_tag_output classmethod

requires_html_tag_output(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[HtmlTagOutputUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def requires_html_tag_output(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[HtmlTagOutputUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any UI types that
    require output as self-contained HTML tags for embedding in other
    HTML pages.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in HtmlTagOutputUserInterfaceType

requires_terminal_output classmethod

requires_terminal_output(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[TerminalOutputUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def requires_terminal_output(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[TerminalOutputUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any UI types that
    require output with ANSI terminal encoding for colors and styles. If
    user interface type is unknown, we assume it is a terminal and try
    to autodetect color capabilities, as default for terminals (see
    `DisplayColorSystem.AUTO`).
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in TerminalOutputUserInterfaceType

supports_dark_terminal_bg_detection classmethod

supports_dark_terminal_bg_detection(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[SupportsDarkTerminalBgDetection.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def supports_dark_terminal_bg_detection(
        cls, ui_type: 'UserInterfaceType.Literals'
) -> TypeIs[SupportsDarkTerminalBgDetection.Literals]:
    f"""
    Check whether the user interface type supports detection of dark
    background color by checking environment variables or using
    ANSI terminal functionality. This is typically the case for
    Jupyter notebooks embedded in IDEs, such as PyCharm, or other
    terminals.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in SupportsDarkTerminalBgDetection

supports_rgb_color_output classmethod

supports_rgb_color_output(
    ui_type: UserInterfaceType.Literals,
) -> TypeIs[RgbColorUserInterfaceType.Literals]
Source code in src/omnipy/shared/enums/ui.py
@classmethod
def supports_rgb_color_output(
        cls,
        ui_type: 'UserInterfaceType.Literals') -> TypeIs[RgbColorUserInterfaceType.Literals]:
    f"""
    Check whether the user interface type refers to any UI types that
    support RGB color output.
     {_TYPEIS_NARROW_NOTE}
    """
    return ui_type in RgbColorUserInterfaceType