Skip to content

omnipy.shared.enums.display

CLASS DESCRIPTION
DarkBackground

Specifies whether the background color of the output is dark or light.

DisplayColorSystem

Supported display color systems for syntax highlighting.

DisplayDimensionsUpdateMode

Specifies how display dimensions should be updated.

HexdumpSyntaxLanguage
HorizontalOverflowMode

Horizontal overflow modes for the output. Horizontal overflow modes have

JsonSyntaxLanguage
Justify

Justification modes for the output.

MaxTitleHeight
PanelDesign

Visual design for the layout of the output.

PrettyPrinterLib

Supported libraries for pretty printing of various data structures.

PythonSyntaxLanguage
SyntaxLanguage

Supported languages for syntax recognition and highlighting.

SyntaxLanguageSpec

Specification of language for syntax recognition and highlighting.

TextSyntaxLanguage
VerticalOverflowMode

Vertical overflow modes for the output. Vertical overflow modes have

DarkBackground

Bases: LiteralEnum[str | bool]

Specifies whether the background color of the output is dark or light.

This is used for selecting the appropriate color scheme for syntax highlighting and other color styles. The dark background mode is automatically detected based on the terminal capabilities, but can be overridden by the user in the configs.

ATTRIBUTE DESCRIPTION
AUTO

Automatically detects whether the background color of the output is dark or light.

TYPE: Literal['auto']

FALSE

Specifies that the background color of the output is light.

TYPE: Literal[False]

Literals

TRUE

Specifies that the background color of the output is dark.

TYPE: Literal[True]

Source code in src/omnipy/shared/enums/display.py
class DarkBackground(LiteralEnum[str | bool]):
    """
    Specifies whether the background color of the output is dark or light.

    This is used for selecting the appropriate color scheme for syntax
    highlighting and other color styles. The dark background mode is
    automatically detected based on the terminal capabilities, but can be
    overridden by the user in the configs.
    """

    Literals = Literal['auto', True, False]

    AUTO: Literal['auto'] = 'auto'
    """Automatically detects whether the background color of the output is dark or light."""

    TRUE: Literal[True] = True
    """Specifies that the background color of the output is dark."""

    FALSE: Literal[False] = False
    """Specifies that the background color of the output is light."""

AUTO class-attribute instance-attribute

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

Automatically detects whether the background color of the output is dark or light.

FALSE class-attribute instance-attribute

FALSE: Literal[False] = False

Specifies that the background color of the output is light.

Literals class-attribute instance-attribute

Literals = Literal['auto', True, False]

TRUE class-attribute instance-attribute

TRUE: Literal[True] = True

Specifies that the background color of the output is dark.

DisplayColorSystem

Bases: LiteralEnum[str]

Supported display color systems for syntax highlighting.

The color systems map to the color systems provided by the Rich library (https://rich.readthedocs.io/en/stable/console.html#color-systems). The names of the Omnipy attributes have been slightly modified to be more descriptive.

ATTRIBUTE DESCRIPTION
ANSI_16

The standard ANSI color system, which supports 16 colors.

TYPE: Literal['standard']

ANSI_256

The extended ANSI color system, which supports 256 colors.

TYPE: Literal['256']

ANSI_RGB

The truecolor ANSI color system, which supports 16 million colors. Most

TYPE: Literal['truecolor']

AUTO

The default color system, which is automatically detected based on the

TYPE: Literal['auto']

Literals

WINDOWS_LEGACY

The legacy Windows color system, for backwards compatibility with older

TYPE: Literal['windows']

Source code in src/omnipy/shared/enums/display.py
class DisplayColorSystem(LiteralEnum[str]):
    """Supported display color systems for syntax highlighting.

    The color systems map to the color systems provided by the Rich library
    (https://rich.readthedocs.io/en/stable/console.html#color-systems).
    The names of the Omnipy attributes have been slightly modified to be
    more descriptive.
    """

    Literals = Literal['auto', 'standard', '256', 'truecolor', 'windows']

    AUTO: Literal['auto'] = 'auto'
    """
    The default color system, which is automatically detected based on the
    terminal capabilities. This is the default value.
    """

    ANSI_16: Literal['standard'] = 'standard'
    """
    The standard ANSI color system, which supports 16 colors.
    """

    ANSI_256: Literal['256'] = '256'
    """
    The extended ANSI color system, which supports 256 colors.
    """

    ANSI_RGB: Literal['truecolor'] = 'truecolor'
    """
    The truecolor ANSI color system, which supports 16 million colors. Most
    modern terminals support this color system.
    """

    WINDOWS_LEGACY: Literal['windows'] = 'windows'
    """
    The legacy Windows color system, for backwards compatibility with older
    Windows terminals.
    """

ANSI_16 class-attribute instance-attribute

ANSI_16: Literal['standard'] = 'standard'

The standard ANSI color system, which supports 16 colors.

ANSI_256 class-attribute instance-attribute

ANSI_256: Literal['256'] = '256'

The extended ANSI color system, which supports 256 colors.

ANSI_RGB class-attribute instance-attribute

ANSI_RGB: Literal['truecolor'] = 'truecolor'

The truecolor ANSI color system, which supports 16 million colors. Most modern terminals support this color system.

AUTO class-attribute instance-attribute

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

The default color system, which is automatically detected based on the terminal capabilities. This is the default value.

Literals class-attribute instance-attribute

Literals = Literal['auto', 'standard', '256', 'truecolor', 'windows']

WINDOWS_LEGACY class-attribute instance-attribute

WINDOWS_LEGACY: Literal['windows'] = 'windows'

The legacy Windows color system, for backwards compatibility with older Windows terminals.

DisplayDimensionsUpdateMode

Bases: LiteralEnum[str]

Specifies how display dimensions should be updated.

ATTRIBUTE DESCRIPTION
AUTO

Automatically updates the width and height dimension configs of the

TYPE: Literal['auto']

FIXED

Updates the width and height dimension config according to the

TYPE: Literal['fixed']

Literals

Source code in src/omnipy/shared/enums/display.py
class DisplayDimensionsUpdateMode(LiteralEnum[str]):
    """
    Specifies how display dimensions should be updated.
    """

    Literals = Literal['auto', 'fixed']

    AUTO: Literal['auto'] = 'auto'
    """
    Automatically updates the `width` and `height` dimension configs of the
    relevant interface output based on the currently available display area
    every time some output renders or (in some cases) when there is a change
    in the available display area (e.g. a window is resized). Automatic
    updates might not work in cases when the available display area can be
    automatically determined (which is e.g. the case for `PYCHARM_TERMINAL`
    and `PYCHARM_IPYTHON` user interface types). In those cases, the
    specified dimensions are kept unchanged. Default values are defined for
    each type of user interface .
    """

    FIXED: Literal['fixed'] = 'fixed'
    """
    Updates the `width` and `height` dimension config according to the
    available display area only once at the start of the program. Default
    values are defined for each type of user interface. The default values
    can be overridden by the user in the configs, however users are then
    advised to first set `dims_mode` to `FIXED` even when the current
    display area cannot be automatically determined. Setting `dims_mode` to
    `FIXED` retains the current dimensions at the time of the setting.
    """

AUTO class-attribute instance-attribute

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

Automatically updates the width and height dimension configs of the relevant interface output based on the currently available display area every time some output renders or (in some cases) when there is a change in the available display area (e.g. a window is resized). Automatic updates might not work in cases when the available display area can be automatically determined (which is e.g. the case for PYCHARM_TERMINAL and PYCHARM_IPYTHON user interface types). In those cases, the specified dimensions are kept unchanged. Default values are defined for each type of user interface .

FIXED class-attribute instance-attribute

FIXED: Literal['fixed'] = 'fixed'

Updates the width and height dimension config according to the available display area only once at the start of the program. Default values are defined for each type of user interface. The default values can be overridden by the user in the configs, however users are then advised to first set dims_mode to FIXED even when the current display area cannot be automatically determined. Setting dims_mode to FIXED retains the current dimensions at the time of the setting.

Literals class-attribute instance-attribute

Literals = Literal['auto', 'fixed']

HexdumpSyntaxLanguage

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
HEXDUMP

TYPE: Literal['hexdump']

Literals

Source code in src/omnipy/shared/enums/display.py
class HexdumpSyntaxLanguage(LiteralEnum[str]):
    Literals = Literal['hexdump']

    HEXDUMP: Literal['hexdump'] = 'hexdump'

HEXDUMP class-attribute instance-attribute

HEXDUMP: Literal['hexdump'] = 'hexdump'

Literals class-attribute instance-attribute

Literals = Literal['hexdump']

HorizontalOverflowMode

Bases: LiteralEnum[str]

Horizontal overflow modes for the output. Horizontal overflow modes have no effect on layout panels.

The horizontal overflow modes are: - ELLIPSIS: Adds an ellipsis (...) at the end of the line if it exceeds the width. - CROP: Crops the line to fit within the width, without adding an ellipsis. - WRAP: Wraps the line to the next line if it exceeds the width, breaking according to the specified syntax language.

ATTRIBUTE DESCRIPTION
CROP

TYPE: Literal['crop']

ELLIPSIS

TYPE: Literal['ellipsis']

Literals

WRAP

TYPE: Literal['wrap']

Source code in src/omnipy/shared/enums/display.py
class HorizontalOverflowMode(LiteralEnum[str]):
    """
    Horizontal overflow modes for the output. Horizontal overflow modes have
    no effect on layout panels.

    The horizontal overflow modes are:
    - `ELLIPSIS`: Adds an ellipsis (...) at the end of the line if it
        exceeds the width.
    - `CROP`: Crops the line to fit within the width, without adding an
        ellipsis.
    - `WRAP`: Wraps the line to the next line if it exceeds the
        width, breaking according to the specified syntax language.
    """

    Literals = Literal['ellipsis', 'crop', 'wrap']

    ELLIPSIS: Literal['ellipsis'] = 'ellipsis'
    CROP: Literal['crop'] = 'crop'
    WRAP: Literal['wrap'] = 'wrap'

CROP class-attribute instance-attribute

CROP: Literal['crop'] = 'crop'

ELLIPSIS class-attribute instance-attribute

ELLIPSIS: Literal['ellipsis'] = 'ellipsis'

Literals class-attribute instance-attribute

Literals = Literal['ellipsis', 'crop', 'wrap']

WRAP class-attribute instance-attribute

WRAP: Literal['wrap'] = 'wrap'

JsonSyntaxLanguage

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
JSON

TYPE: Literal['json']

JSON5

TYPE: Literal['json5']

JSON_LD

TYPE: Literal['json-ld']

Literals

Source code in src/omnipy/shared/enums/display.py
class JsonSyntaxLanguage(LiteralEnum[str]):
    Literals = Literal['json', 'json5', 'json-ld']

    JSON: Literal['json'] = 'json'
    JSON5: Literal['json5'] = 'json5'
    JSON_LD: Literal['json-ld'] = 'json-ld'

JSON class-attribute instance-attribute

JSON: Literal['json'] = 'json'

JSON5 class-attribute instance-attribute

JSON5: Literal['json5'] = 'json5'

JSON_LD class-attribute instance-attribute

JSON_LD: Literal['json-ld'] = 'json-ld'

Literals class-attribute instance-attribute

Literals = Literal['json', 'json5', 'json-ld']

Justify

Bases: LiteralEnum[str]

Justification modes for the output.

The justification modes are: - LEFT: Left-justified text. - RIGHT: Right-justified text. - CENTER: Centered text.

ATTRIBUTE DESCRIPTION
CENTER

TYPE: Literal['center']

LEFT

TYPE: Literal['left']

Literals

RIGHT

TYPE: Literal['right']

Source code in src/omnipy/shared/enums/display.py
class Justify(LiteralEnum[str]):
    """
    Justification modes for the output.

    The justification modes are:
    - `LEFT`: Left-justified text.
    - `RIGHT`: Right-justified text.
    - `CENTER`: Centered text.
    """

    Literals = Literal['left', 'center', 'right']

    LEFT: Literal['left'] = 'left'
    CENTER: Literal['center'] = 'center'
    RIGHT: Literal['right'] = 'right'

CENTER class-attribute instance-attribute

CENTER: Literal['center'] = 'center'

LEFT class-attribute instance-attribute

LEFT: Literal['left'] = 'left'

Literals class-attribute instance-attribute

Literals = Literal['left', 'center', 'right']

RIGHT class-attribute instance-attribute

RIGHT: Literal['right'] = 'right'

MaxTitleHeight

Bases: LiteralEnum[int]

ATTRIBUTE DESCRIPTION
AUTO

TYPE: Literal[-1]

Literals

ONE

TYPE: Literal[1]

TWO

TYPE: Literal[2]

ZERO

TYPE: Literal[0]

Source code in src/omnipy/shared/enums/display.py
class MaxTitleHeight(LiteralEnum[int]):
    Literals = Literal[-1, 0, 1, 2]

    AUTO: Literal[-1] = -1
    ZERO: Literal[0] = 0
    ONE: Literal[1] = 1
    TWO: Literal[2] = 2

AUTO class-attribute instance-attribute

AUTO: Literal[-1] = -1

Literals class-attribute instance-attribute

Literals = Literal[-1, 0, 1, 2]

ONE class-attribute instance-attribute

ONE: Literal[1] = 1

TWO class-attribute instance-attribute

TWO: Literal[2] = 2

ZERO class-attribute instance-attribute

ZERO: Literal[0] = 0

PanelDesign

Bases: LiteralEnum[str]

Visual design for the layout of the output.

The layout designs are: - TABLE: The output is displayed as a simple table grid - TABLE_SHOW_STYLE: The output is displayed as a simple table grid - PANELS: The output is displayed as a set of panels

ATTRIBUTE DESCRIPTION
Literals

PANELS

TYPE: Literal['panels']

TABLE

TYPE: Literal['table']

TABLE_SHOW_STYLE

TYPE: Literal['table_show_style']

Source code in src/omnipy/shared/enums/display.py
class PanelDesign(LiteralEnum[str]):
    """
    Visual design for the layout of the output.

    The layout designs are:
    - `TABLE`: The output is displayed as a simple table grid
    - `TABLE_SHOW_STYLE`: The output is displayed as a simple table grid
    - `PANELS`: The output is displayed as a set of panels
    """

    Literals = Literal['table', 'table_show_style', 'panels']

    TABLE: Literal['table'] = 'table'
    TABLE_SHOW_STYLE: Literal['table_show_style'] = 'table_show_style'
    PANELS: Literal['panels'] = 'panels'

Literals class-attribute instance-attribute

Literals = Literal['table', 'table_show_style', 'panels']

PANELS class-attribute instance-attribute

PANELS: Literal['panels'] = 'panels'

TABLE class-attribute instance-attribute

TABLE: Literal['table'] = 'table'

TABLE_SHOW_STYLE class-attribute instance-attribute

TABLE_SHOW_STYLE: Literal['table_show_style'] = 'table_show_style'

PrettyPrinterLib

Bases: LiteralEnum[str]

Supported libraries for pretty printing of various data structures.

Comparison of RICH and DEVTOOLS for Python structures: the outputs are more or less the same. However, the RICH library formats the width of the output on a per-item basis, while the DEVTOOLS library formats the width of the output based on the maximum width of the output. This means that the RICH library will in many cases produce a more compact output, which is typically recommended. However, the DEVTOOLS library might be more suitable for visualizing Pydantic models with debug_mode set to True, as it is specifically designed for that purpose.

ATTRIBUTE DESCRIPTION
AUTO

Automatically selects the pretty printer.

TYPE: Literal['auto']

CODE

Code pretty printer.

TYPE: Literal['code']

COLUMN

Column pretty printer.

TYPE: Literal['column']

COMPACT_JSON

Compact JSON pretty printer.

TYPE: Literal['compact-json']

DEVTOOLS

Devtools pretty printer for Python objects.

TYPE: Literal['devtools']

HEXDUMP

Hexdump pretty printer.

TYPE: Literal['hexdump']

Literals

RICH

Rich pretty printer for Python objects.

TYPE: Literal['rich']

TEXT

Text pretty printer.

TYPE: Literal['text']

Source code in src/omnipy/shared/enums/display.py
class PrettyPrinterLib(LiteralEnum[str]):
    """
    Supported libraries for pretty printing of various data structures.

    Comparison of RICH and DEVTOOLS for Python structures: the outputs are
    more or less the same. However, the RICH library formats the width of
    the output on a per-item basis, while the DEVTOOLS library formats the
    width of the output based on the maximum width of the output. This means
    that the RICH library will in many cases produce a more compact output,
    which is typically recommended. However, the DEVTOOLS library might be
    more suitable for visualizing Pydantic models with debug_mode set to
    `True`, as it is specifically designed for that purpose.
    """

    Literals = Literal['rich',
                       'devtools',
                       'compact-json',
                       'text',
                       'code',
                       'column',
                       'hexdump',
                       'auto']

    RICH: Literal['rich'] = 'rich'
    """Rich pretty printer for Python objects.

    The pretty printer of Rich library
    (https://rich.readthedocs.io/en/stable/), a general-purpose formatter
    of Python objects. This is the default value.
    """

    DEVTOOLS: Literal['devtools'] = 'devtools'
    """Devtools pretty printer for Python objects.

    The pretty printer of the Devtools library
    (https://python-devtools.helpmanual.io/), a general-purpose formatter
    of Python objects and specifically designed for visualizing Pydantic
    models.
    """

    COMPACT_JSON: Literal['compact-json'] = 'compact-json'
    """Compact JSON pretty printer.

    The compact-json library (https://github.com/masaccio/compact-json),
    which is used for compact formatting of JSON data structures.
    """

    TEXT: Literal['text'] = 'text'
    """Text pretty printer.

    The plain text pretty printer, which is used for displaying plain text
    content.
    """

    CODE: Literal['code'] = 'code'
    """Code pretty printer.

    The code pretty printer, which is used for displaying plain text
    containing code. The default syntax is Python.
    """

    COLUMN: Literal['column'] = 'column'
    """Column pretty printer.

    The column pretty printer is the basis for tabular data display in
    Omnipy, with the regular panel layout providing the table formatting.
    """

    HEXDUMP: Literal['hexdump'] = 'hexdump'
    """Hexdump pretty printer.

    Hexdump pretty printer based on [simple-hexdump](https://pypi.org/project/simple-hexdump/)
    for displaying binary content.
    """

    AUTO: Literal['auto'] = 'auto'
    """Automatically selects the pretty printer.

    The auto-selection of the pretty printer is based on:

    1.  Autodetection of the pretty printer based on specific content types,
        such as StrModel, ColumnModel, or PrintableTable.

    2.  The `syntax` config parameter, if other than `AUTO`. The pretty
        printer is set to the default pretty printer for the specified
        syntax language subgroup (see subtypes of `SyntaxLanguage`).

    3.  If the `syntax` config parameter is set to `AUTO`, the pretty
        printer is finally determined based on the content of the output,
        this time in default mode.

    Note: the default pretty printer for a syntax language subgroup is
        currently  determined in the `get_pretty_printer_from_syntax()`
        function in  `omnipy.data._display.text.pretty_printer.register`,
        while the mapping of content types to pretty printers is determined
        in the `get_pretty_printer_from_content()` function in the same
        module, based on the `is_suitable_content()` method of each pretty
        printer class. The implementation of determining the pretty printer
        when set to `AUTO` will likely change in the future.
    """

AUTO class-attribute instance-attribute

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

Automatically selects the pretty printer.

The auto-selection of the pretty printer is based on:

  1. Autodetection of the pretty printer based on specific content types, such as StrModel, ColumnModel, or PrintableTable.

  2. The syntax config parameter, if other than AUTO. The pretty printer is set to the default pretty printer for the specified syntax language subgroup (see subtypes of SyntaxLanguage).

  3. If the syntax config parameter is set to AUTO, the pretty printer is finally determined based on the content of the output, this time in default mode.

the default pretty printer for a syntax language subgroup is

currently determined in the get_pretty_printer_from_syntax() function in omnipy.data._display.text.pretty_printer.register, while the mapping of content types to pretty printers is determined in the get_pretty_printer_from_content() function in the same module, based on the is_suitable_content() method of each pretty printer class. The implementation of determining the pretty printer when set to AUTO will likely change in the future.

CODE class-attribute instance-attribute

CODE: Literal['code'] = 'code'

Code pretty printer.

The code pretty printer, which is used for displaying plain text containing code. The default syntax is Python.

COLUMN class-attribute instance-attribute

COLUMN: Literal['column'] = 'column'

Column pretty printer.

The column pretty printer is the basis for tabular data display in Omnipy, with the regular panel layout providing the table formatting.

COMPACT_JSON class-attribute instance-attribute

COMPACT_JSON: Literal['compact-json'] = 'compact-json'

Compact JSON pretty printer.

The compact-json library (https://github.com/masaccio/compact-json), which is used for compact formatting of JSON data structures.

DEVTOOLS class-attribute instance-attribute

DEVTOOLS: Literal['devtools'] = 'devtools'

Devtools pretty printer for Python objects.

The pretty printer of the Devtools library (https://python-devtools.helpmanual.io/), a general-purpose formatter of Python objects and specifically designed for visualizing Pydantic models.

HEXDUMP class-attribute instance-attribute

HEXDUMP: Literal['hexdump'] = 'hexdump'

Hexdump pretty printer.

Hexdump pretty printer based on simple-hexdump for displaying binary content.

Literals class-attribute instance-attribute

Literals = Literal['rich', 'devtools', 'compact-json', 'text', 'code', 'column', 'hexdump', 'auto']

RICH class-attribute instance-attribute

RICH: Literal['rich'] = 'rich'

Rich pretty printer for Python objects.

The pretty printer of Rich library (https://rich.readthedocs.io/en/stable/), a general-purpose formatter of Python objects. This is the default value.

TEXT class-attribute instance-attribute

TEXT: Literal['text'] = 'text'

Text pretty printer.

The plain text pretty printer, which is used for displaying plain text content.

PythonSyntaxLanguage

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
Literals

PYTHON

TYPE: Literal['python']

Source code in src/omnipy/shared/enums/display.py
class PythonSyntaxLanguage(LiteralEnum[str]):
    Literals = Literal['python']

    PYTHON: Literal['python'] = 'python'

Literals class-attribute instance-attribute

Literals = Literal['python']

PYTHON class-attribute instance-attribute

PYTHON: Literal['python'] = 'python'

SyntaxLanguage

Bases: JsonSyntaxLanguage, TextSyntaxLanguage, HexdumpSyntaxLanguage, PythonSyntaxLanguage

Supported languages for syntax recognition and highlighting.

A selected subset of the lexer languages supported by the Pygments library (https://pygments.org/languages/), assumed to be the ones most relevant for Omnipy.

ATTRIBUTE DESCRIPTION
Literals

Source code in src/omnipy/shared/enums/display.py
class SyntaxLanguage(JsonSyntaxLanguage,
                     TextSyntaxLanguage,
                     HexdumpSyntaxLanguage,
                     PythonSyntaxLanguage):
    """
    Supported languages for syntax recognition and highlighting.

    A selected subset of the lexer languages supported by the Pygments
    library (https://pygments.org/languages/), assumed to be the ones most
    relevant for Omnipy.
    """

    Literals = Literal[JsonSyntaxLanguage.Literals,
                       TextSyntaxLanguage.Literals,
                       HexdumpSyntaxLanguage.Literals,
                       PythonSyntaxLanguage.Literals]

Literals class-attribute instance-attribute

SyntaxLanguageSpec

Bases: SyntaxLanguage

Specification of language for syntax recognition and highlighting.

The available values include all supported syntax languages (see SyntaxLanguage), plus the AUTO option for automatic syntax recognition.

METHOD DESCRIPTION
is_hexdump_syntax

Checks if the given syntax is a binary hexdump variant.

is_json_syntax

Checks if the given syntax is a JSON syntax.

is_python_syntax

Checks if the given syntax is a Python variant.

is_supported_syntax_language

Checks if the given syntax is a supported syntax language.

is_syntax_language_spec

Checks for a valid syntax language specification.

is_text_syntax

Checks if the given syntax is a general text syntax.

ATTRIBUTE DESCRIPTION
AUTO

Automatically select the syntax language.

TYPE: Literal['auto']

Literals

Source code in src/omnipy/shared/enums/display.py
class SyntaxLanguageSpec(SyntaxLanguage):
    """Specification of language for syntax recognition and highlighting.

    The available values include all supported syntax languages (see
    `SyntaxLanguage`), plus the  `AUTO` option for automatic syntax
    recognition.
    """

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

    AUTO: Literal['auto'] = 'auto'
    """Automatically select the syntax language.

    Automatically set the syntax language in accordance with the specified
    pretty printer selected for the output (e.g. specified in `printer`
    config parameter). The syntax language specified in the
    `get_default_syntax_language()` class method is selected.
    """
    @classmethod
    def is_syntax_language_spec(cls, syntax: str) -> 'TypeIs[SyntaxLanguageSpec.Literals]':
        """Checks for a valid syntax language specification.

        This checks whether the syntax string is one of the supported
        options for syntax language specification (including `AUTO`).
        """
        return syntax in SyntaxLanguageSpec

    @classmethod
    def is_supported_syntax_language(
        cls,
        syntax: str,
    ) -> 'TypeIs[SyntaxLanguage.Literals]':
        """Checks if the given syntax is a supported syntax language.
        """
        return syntax in SyntaxLanguage

    @classmethod
    def is_json_syntax(cls, syntax: str) -> TypeIs[JsonSyntaxLanguage.Literals]:
        """Checks if the given syntax is a JSON syntax.
        """
        return syntax in JsonSyntaxLanguage

    @classmethod
    def is_text_syntax(cls, syntax: str) -> TypeIs[TextSyntaxLanguage.Literals]:
        """Checks if the given syntax is a general text syntax.
        """
        return syntax in TextSyntaxLanguage

    @classmethod
    def is_hexdump_syntax(cls, syntax: str) -> TypeIs[HexdumpSyntaxLanguage.Literals]:
        """Checks if the given syntax is a binary hexdump variant.
        """
        return syntax in HexdumpSyntaxLanguage

    @classmethod
    def is_python_syntax(cls, syntax: str) -> TypeIs[PythonSyntaxLanguage.Literals]:
        """Checks if the given syntax is a Python variant.
        """
        return syntax in PythonSyntaxLanguage

AUTO class-attribute instance-attribute

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

Automatically select the syntax language.

Automatically set the syntax language in accordance with the specified pretty printer selected for the output (e.g. specified in printer config parameter). The syntax language specified in the get_default_syntax_language() class method is selected.

Literals class-attribute instance-attribute

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

is_hexdump_syntax classmethod

is_hexdump_syntax(syntax: str) -> TypeIs[HexdumpSyntaxLanguage.Literals]

Checks if the given syntax is a binary hexdump variant.

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_hexdump_syntax(cls, syntax: str) -> TypeIs[HexdumpSyntaxLanguage.Literals]:
    """Checks if the given syntax is a binary hexdump variant.
    """
    return syntax in HexdumpSyntaxLanguage

is_json_syntax classmethod

is_json_syntax(syntax: str) -> TypeIs[JsonSyntaxLanguage.Literals]

Checks if the given syntax is a JSON syntax.

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_json_syntax(cls, syntax: str) -> TypeIs[JsonSyntaxLanguage.Literals]:
    """Checks if the given syntax is a JSON syntax.
    """
    return syntax in JsonSyntaxLanguage

is_python_syntax classmethod

is_python_syntax(syntax: str) -> TypeIs[PythonSyntaxLanguage.Literals]

Checks if the given syntax is a Python variant.

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_python_syntax(cls, syntax: str) -> TypeIs[PythonSyntaxLanguage.Literals]:
    """Checks if the given syntax is a Python variant.
    """
    return syntax in PythonSyntaxLanguage

is_supported_syntax_language classmethod

is_supported_syntax_language(syntax: str) -> TypeIs[SyntaxLanguage.Literals]

Checks if the given syntax is a supported syntax language.

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_supported_syntax_language(
    cls,
    syntax: str,
) -> 'TypeIs[SyntaxLanguage.Literals]':
    """Checks if the given syntax is a supported syntax language.
    """
    return syntax in SyntaxLanguage

is_syntax_language_spec classmethod

is_syntax_language_spec(syntax: str) -> TypeIs[SyntaxLanguageSpec.Literals]

Checks for a valid syntax language specification.

This checks whether the syntax string is one of the supported options for syntax language specification (including AUTO).

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_syntax_language_spec(cls, syntax: str) -> 'TypeIs[SyntaxLanguageSpec.Literals]':
    """Checks for a valid syntax language specification.

    This checks whether the syntax string is one of the supported
    options for syntax language specification (including `AUTO`).
    """
    return syntax in SyntaxLanguageSpec

is_text_syntax classmethod

is_text_syntax(syntax: str) -> TypeIs[TextSyntaxLanguage.Literals]

Checks if the given syntax is a general text syntax.

Source code in src/omnipy/shared/enums/display.py
@classmethod
def is_text_syntax(cls, syntax: str) -> TypeIs[TextSyntaxLanguage.Literals]:
    """Checks if the given syntax is a general text syntax.
    """
    return syntax in TextSyntaxLanguage

TextSyntaxLanguage

Bases: LiteralEnum[str]

ATTRIBUTE DESCRIPTION
BASH

TYPE: Literal['bash']

CSS

TYPE: Literal['css']

HTML

TYPE: Literal['html']

Literals

MARKDOWN

TYPE: Literal['markdown']

NUMPY

TYPE: Literal['numpy']

SPARQL

TYPE: Literal['sparql']

SQL

TYPE: Literal['sql']

TEX

TYPE: Literal['tex']

TEXT

TYPE: Literal['text']

TOML

TYPE: Literal['toml']

XML

TYPE: Literal['xml']

YAML

TYPE: Literal['yaml']

Source code in src/omnipy/shared/enums/display.py
class TextSyntaxLanguage(LiteralEnum[str]):
    Literals = Literal['text',
                       'yaml',
                       'xml',
                       'toml',
                       'bash',
                       'sql',
                       'html',
                       'markdown',
                       'css',
                       'numpy',
                       'sparql',
                       'tex']

    TEXT: Literal['text'] = 'text'
    YAML: Literal['yaml'] = 'yaml'
    XML: Literal['xml'] = 'xml'
    TOML: Literal['toml'] = 'toml'
    BASH: Literal['bash'] = 'bash'
    SQL: Literal['sql'] = 'sql'
    HTML: Literal['html'] = 'html'
    MARKDOWN: Literal['markdown'] = 'markdown'
    NUMPY: Literal['numpy'] = 'numpy'
    CSS: Literal['css'] = 'css'
    SPARQL: Literal['sparql'] = 'sparql'
    TEX: Literal['tex'] = 'tex'

BASH class-attribute instance-attribute

BASH: Literal['bash'] = 'bash'

CSS class-attribute instance-attribute

CSS: Literal['css'] = 'css'

HTML class-attribute instance-attribute

HTML: Literal['html'] = 'html'

Literals class-attribute instance-attribute

Literals = Literal[
    "text",
    "yaml",
    "xml",
    "toml",
    "bash",
    "sql",
    "html",
    "markdown",
    "css",
    "numpy",
    "sparql",
    "tex",
]

MARKDOWN class-attribute instance-attribute

MARKDOWN: Literal['markdown'] = 'markdown'

NUMPY class-attribute instance-attribute

NUMPY: Literal['numpy'] = 'numpy'

SPARQL class-attribute instance-attribute

SPARQL: Literal['sparql'] = 'sparql'

SQL class-attribute instance-attribute

SQL: Literal['sql'] = 'sql'

TEX class-attribute instance-attribute

TEX: Literal['tex'] = 'tex'

TEXT class-attribute instance-attribute

TEXT: Literal['text'] = 'text'

TOML class-attribute instance-attribute

TOML: Literal['toml'] = 'toml'

XML class-attribute instance-attribute

XML: Literal['xml'] = 'xml'

YAML class-attribute instance-attribute

YAML: Literal['yaml'] = 'yaml'

VerticalOverflowMode

Bases: LiteralEnum[str]

Vertical overflow modes for the output. Vertical overflow modes have no effect on layout panels.

The vertical overflow modes are: - CROP_TOP: Crops the top of the output if it exceeds the height. - CROP_BOTTOM: Crops the bottom of the output if it exceeds the height.

ATTRIBUTE DESCRIPTION
CROP_BOTTOM

TYPE: Literal['crop_bottom']

CROP_TOP

TYPE: Literal['crop_top']

ELLIPSIS_BOTTOM

TYPE: Literal['ellipsis_bottom']

ELLIPSIS_TOP

TYPE: Literal['ellipsis_top']

Literals

Source code in src/omnipy/shared/enums/display.py
class VerticalOverflowMode(LiteralEnum[str]):
    """
    Vertical overflow modes for the output. Vertical overflow modes have
    no effect on layout panels.

    The vertical overflow modes are:
    - `CROP_TOP`: Crops the top of the output if it exceeds the height.
    - `CROP_BOTTOM`: Crops the bottom of the output if it exceeds the
        height.
    """

    Literals = Literal['crop_top', 'crop_bottom', 'ellipsis_top', 'ellipsis_bottom']

    CROP_TOP: Literal['crop_top'] = 'crop_top'
    CROP_BOTTOM: Literal['crop_bottom'] = 'crop_bottom'
    ELLIPSIS_TOP: Literal['ellipsis_top'] = 'ellipsis_top'
    ELLIPSIS_BOTTOM: Literal['ellipsis_bottom'] = 'ellipsis_bottom'

CROP_BOTTOM class-attribute instance-attribute

CROP_BOTTOM: Literal['crop_bottom'] = 'crop_bottom'

CROP_TOP class-attribute instance-attribute

CROP_TOP: Literal['crop_top'] = 'crop_top'

ELLIPSIS_BOTTOM class-attribute instance-attribute

ELLIPSIS_BOTTOM: Literal['ellipsis_bottom'] = 'ellipsis_bottom'

ELLIPSIS_TOP class-attribute instance-attribute

ELLIPSIS_TOP: Literal['ellipsis_top'] = 'ellipsis_top'

Literals class-attribute instance-attribute

Literals = Literal['crop_top', 'crop_bottom', 'ellipsis_top', 'ellipsis_bottom']