A convenience function for pretty printing. Args: _object (Any): Object to pretty print. console (Console, optional): Console instance, or None to use default. Defaults to None. max_length (int, optional): Maximum length of containers before abbreviating, or None for no
(
_object: Any,
*,
console: Optional["Console"] = None,
indent_guides: bool = True,
max_length: Optional[int] = None,
max_string: Optional[int] = None,
max_depth: Optional[int] = None,
expand_all: bool = False,
)
| 916 | |
| 917 | |
| 918 | def pprint( |
| 919 | _object: Any, |
| 920 | *, |
| 921 | console: Optional["Console"] = None, |
| 922 | indent_guides: bool = True, |
| 923 | max_length: Optional[int] = None, |
| 924 | max_string: Optional[int] = None, |
| 925 | max_depth: Optional[int] = None, |
| 926 | expand_all: bool = False, |
| 927 | ) -> None: |
| 928 | """A convenience function for pretty printing. |
| 929 | |
| 930 | Args: |
| 931 | _object (Any): Object to pretty print. |
| 932 | console (Console, optional): Console instance, or None to use default. Defaults to None. |
| 933 | max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. |
| 934 | Defaults to None. |
| 935 | max_string (int, optional): Maximum length of strings before truncating, or None to disable. Defaults to None. |
| 936 | max_depth (int, optional): Maximum depth for nested data structures, or None for unlimited depth. Defaults to None. |
| 937 | indent_guides (bool, optional): Enable indentation guides. Defaults to True. |
| 938 | expand_all (bool, optional): Expand all containers. Defaults to False. |
| 939 | """ |
| 940 | _console = get_console() if console is None else console |
| 941 | _console.print( |
| 942 | Pretty( |
| 943 | _object, |
| 944 | max_length=max_length, |
| 945 | max_string=max_string, |
| 946 | max_depth=max_depth, |
| 947 | indent_guides=indent_guides, |
| 948 | expand_all=expand_all, |
| 949 | overflow="ignore", |
| 950 | ), |
| 951 | soft_wrap=True, |
| 952 | ) |
| 953 | |
| 954 | |
| 955 | if __name__ == "__main__": # pragma: no cover |