
    F\h*                         S r SSKrSSKrSSKrS r\S:X  a	   \" 5         gg! \ a&  r\R                  " \R                  5         SrCgSrCff = f)a  Command-line tool to validate and pretty-print JSON

Usage::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

    Nc                     Sn Sn[         R                  " XS9nUR                  SSSSS9  UR                  S	SS
S S9  UR                  SSSSS9  UR                  SSSSS9  UR                  SSSSS9  UR                  5       nUR                  SS[        SS9  UR                  SSSSSS 9  UR                  S!SSS S"S 9  UR                  S#SS$S%9  UR                  5       nUR                  UR                  UR                  S&.nUR                  (       a
  S US'   S'US('    UR                  S:X  a  [        R                  nO[        UR                  S)S*9n UR                  (       a
  S+ U 5       nO[        R                   " U5      4nU[        R                  La  UR#                  5         UR$                  c  [        R&                  nO[        UR$                  S,S)S*9nU   U H+  n	[        R(                  " X40 UD6  UR+                  S-5        M-     S S S 5        g ! U[        R                  La  UR#                  5         f f = f! , (       d  f       g = f! [,         a  n
[/        U
5      eS n
A
ff = f).Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)progdescriptioninfile?z-a JSON file to be validated or pretty-printed-)nargshelpdefaultoutfilez%write the output of infile to outfilez--sort-keys
store_trueFz5sort the output of dictionaries alphabetically by key)actionr   r
   z--no-ensure-asciiensure_asciistore_falsez(disable escaping of non-ASCII characters)destr   r
   z--json-linesznparse input using the JSON Lines format. Use with --no-indent or --compact to produce valid JSON Lines output.z--indent   zJseparate items with newlines and use this number of spaces for indentation)r   typer
   z--tabstore_constindent	z9separate items with newlines and use tabs for indentation)r   r   constr
   z--no-indentz/separate items with spaces rather than newlinesz	--compactz1suppress all whitespace separation (most compact))r   r
   )	sort_keysr   r   ),:
separatorszutf-8)encodingc              3   N   #    U  H  n[         R                  " U5      v   M     g 7f)N)jsonloads).0lines      /usr/lib/python3.13/json/tool.py	<genexpr>main.<locals>.<genexpr>B   s     <VT

4((Vs   #%w
)argparseArgumentParseradd_argumentadd_mutually_exclusive_groupint
parse_argsr   r   r   compactr   sysstdinopen
json_linesr   loadcloser   stdoutdumpwrite
ValueError
SystemExit)r   r   parsergroupoptions	dump_argsr   objsr   objes              r"   mainr@      s    D@K$$$HF
L #  % 	D $  & lET  V
+.G  I
|U`  a //1E	z133  4 
w}8! ).  / 
}]!M  O 
{<O  Q!G &&..,,I
 "	("*	,>>S YYF'..7;F	!!<V<		&)+SYY&??"jjG7??C'BG		#4)4d#  W SYY& ' W  msO    5I 2H AI  2II &II 
II I 
I/I**I/__main__)
__doc__r'   r   r.   r@   __name__BrokenPipeErrorexcexiterrno     r"   <module>rJ      sZ      
@F z   s   " AA		A