MCPcopy
hub / github.com/Textualize/rich / __init__

Method __init__

rich/json.py:25–51  ·  view source on GitHub ↗
(
        self,
        json: str,
        indent: Union[None, int, str] = 2,
        highlight: bool = True,
        skip_keys: bool = False,
        ensure_ascii: bool = False,
        check_circular: bool = True,
        allow_nan: bool = True,
        default: Optional[Callable[[Any], Any]] = None,
        sort_keys: bool = False,
    )

Source from the content-addressed store, hash-verified

23 """
24
25 def __init__(
26 self,
27 json: str,
28 indent: Union[None, int, str] = 2,
29 highlight: bool = True,
30 skip_keys: bool = False,
31 ensure_ascii: bool = False,
32 check_circular: bool = True,
33 allow_nan: bool = True,
34 default: Optional[Callable[[Any], Any]] = None,
35 sort_keys: bool = False,
36 ) -> None:
37 data = loads(json)
38 json = dumps(
39 data,
40 indent=indent,
41 skipkeys=skip_keys,
42 ensure_ascii=ensure_ascii,
43 check_circular=check_circular,
44 allow_nan=allow_nan,
45 default=default,
46 sort_keys=sort_keys,
47 )
48 highlighter = JSONHighlighter() if highlight else NullHighlighter()
49 self.text = highlighter(json)
50 self.text.no_wrap = True
51 self.text.overflow = None
52
53 @classmethod
54 def from_data(

Callers

nothing calls this directly

Calls 2

JSONHighlighterClass · 0.85
NullHighlighterClass · 0.85

Tested by

no test coverage detected