def install(console: 'Console'=None, overflow: 'OverflowMethod'='ignore', crop: bool=False, indent_guides: bool=False, max_length: int=None, max_string: int=None, expand_all: bool=False) -> None:
    'Install automatic pretty printing in the Python REPL.\n\n    Args:\n        console (Console, optional): Console instance or ``None`` to use global console. Defaults to None.\n        overflow (Optional[OverflowMethod], optional): Overflow method. Defaults to "ignore".\n        crop (Optional[bool], optional): Enable cropping of long lines. Defaults to False.\n        indent_guides (bool, optional): Enable indentation guides. Defaults to False.\n        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.\n            Defaults to None.\n        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.\n        expand_all (bool, optional): Expand all containers. Defaults to False\n    '
    from rich import get_console
    from .console import ConsoleRenderable
    console = (console or get_console())
    assert (console is not None)

    def display_hook(value: Any) -> None:
        'Replacement sys.displayhook which prettifies objects with Rich.'
        if (value is not None):
            assert (console is not None)
            builtins._ = None
            console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=indent_guides, max_length=max_length, max_string=max_string, expand_all=expand_all)), crop=crop)
            builtins._ = value

    def ipy_display_hook(value: Any) -> None:
        assert (console is not None)
        if (isinstance(value, JupyterRenderable) or (value is None)):
            return
        if (console.is_jupyter and any((attr.startswith('_repr_') for attr in dir(value)))):
            return
        if hasattr(value, '_repr_mimebundle_'):
            return
        if isinstance(value, ConsoleRenderable):
            console.line()
        console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=indent_guides, max_length=max_length, max_string=max_string, expand_all=expand_all, margin=12)), crop=crop)
    try:
        ip = get_ipython()
        from IPython.core.formatters import BaseFormatter
        rich_formatter = BaseFormatter()
        rich_formatter.for_type(object, func=ipy_display_hook)
        ip.display_formatter.formatters['text/plain'] = rich_formatter
    except Exception:
        sys.displayhook = display_hook
Install automatic pretty printing in the Python REPL.

Args:
    console (Console, optional): Console instance or ``None`` to use global console. Defaults to None.
    overflow (Optional[OverflowMethod], optional): Overflow method. Defaults to "ignore".
    crop (Optional[bool], optional): Enable cropping of long lines. Defaults to False.
    indent_guides (bool, optional): Enable indentation guides. Defaults to False.
    max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
        Defaults to None.
    max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.
    expand_all (bool, optional): Expand all containers. Defaults to False
def install(console: 'Console'=None, overflow: 'OverflowMethod'='ignore', crop: bool=False, indent_guides: bool=False, max_length: int=None, max_string: int=None, expand_all: bool=False) -> None:
    'Install automatic pretty printing in the Python REPL.\n\n    Args:\n        console (Console, optional): Console instance or ``None`` to use global console. Defaults to None.\n        overflow (Optional[OverflowMethod], optional): Overflow method. Defaults to "ignore".\n        crop (Optional[bool], optional): Enable cropping of long lines. Defaults to False.\n        indent_guides (bool, optional): Enable indentation guides. Defaults to False.\n        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.\n            Defaults to None.\n        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.\n        expand_all (bool, optional): Expand all containers. Defaults to False\n    '
    from rich import get_console
    from .console import ConsoleRenderable
    console = (console or get_console())
    assert (console is not None)

    def display_hook(value: Any) -> None:
        'Replacement sys.displayhook which prettifies objects with Rich.'
        if (value is not None):
            assert (console is not None)
            builtins._ = None
            console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=indent_guides, max_length=max_length, max_string=max_string, expand_all=expand_all)), crop=crop)
            builtins._ = value

    def ipy_display_hook(value: Any) -> None:
        assert (console is not None)
        if (isinstance(value, JupyterRenderable) or (value is None)):
            return
        if (console.is_jupyter and any((attr.startswith('_repr_') for attr in dir(value)))):
            return
        if hasattr(value, '_repr_mimebundle_'):
            return
        if isinstance(value, ConsoleRenderable):
            console.line()
        console.print((value if isinstance(value, RichRenderable) else Pretty(value, overflow=overflow, indent_guides=indent_guides, max_length=max_length, max_string=max_string, expand_all=expand_all, margin=12)), crop=crop)
    try:
        ip = get_ipython()
        from IPython.core.formatters import BaseFormatter
        rich_formatter = BaseFormatter()
        rich_formatter.for_type(object, func=ipy_display_hook)
        ip.display_formatter.formatters['text/plain'] = rich_formatter
    except Exception:
        sys.displayhook = display_hook