Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias identifier Assign NameStore Str FunctionDef arguments args defaults body Expr Str Import alias ImportFrom alias alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad Num Assign NameStore BoolOpOr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Call NameLoad Print NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad Call NameLoad NameLoad IfExp AttributeLoad NameLoad attr Call NameLoad Call NameLoad attr Str Print NameLoad handlers ExceptHandler type TupleLoad NameLoad AttributeLoad NameLoad attr name NameStore body Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad Str attr ListLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Str Expr Call NameLoad Num decorator_list FunctionDef arguments args defaults body Expr Str TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Lambda arguments args NameParam NameParam defaults Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad body Pass TryExcept body Expr Call NameLoad handlers ExceptHandler type NameLoad body Expr Call NameLoad Num decorator_list
N/A N/A 
Command-line tool to validate and pretty-print JSON and XML.

Based on `python -mjson.tool` but without the crap.

Usage::

    $ echo '{"json":"obj"}' | pjson
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | pjson
    Expecting property name: line 1 column 2 (char 2)


Author: Igor Guerrero <igfgt1@gmail.com>, 2012
 N/A sys N/A signal sys exit xml.etree ElementTree ET N/A __version__ 0.9 _main N/A N/A N/A N/A N/A 
    Main function to execute everything in order
     N/A argparse pygments.lexers JsonLexer XmlLexer pjson.core format_code color_yo_shit N/A parser N/A N/A argparse ArgumentParser description Command-line tool to validate and pretty-print JSON and XML N/A N/A N/A parser add_argument -x action store_true help Data is XML N/A N/A N/A parser add_argument -b action store_true help Read data in chunks N/A N/A N/A parser add_argument -t action store_true help Colorize regardless if output is a terminal N/A args N/A N/A parser parse_args N/A N/A N/A args x N/A args b N/A N/A N/A N/A N/A sys stderr write -x and -b cannot be used simultaneously
 N/A N/A N/A parser print_usage N/A sys stderr N/A N/A exit 1 N/A colorize N/A N/A args t N/A N/A N/A sys stdout isatty N/A N/A args b N/A N/A line N/A sys stdin N/A N/A text N/A format_code line N/A colorize N/A N/A text N/A color_yo_shit text N/A JsonLexer N/A text N/A N/A data N/A N/A N/A sys stdin read N/A N/A N/A text N/A format_code data N/A args x N/A colorize N/A N/A text N/A N/A N/A color_yo_shit text N/A N/A args x N/A XmlLexer N/A JsonLexer rstrip N/A text N/A N/A N/A N/A ValueError N/A ET ParseError N/A e N/A N/A message N/A str e N/A colorize N/A N/A red [31;m N/A reset_colors [0;m N/A message N/A N/A join N/A red message reset_colors N/A N/A N/A N/A sys stderr write N/A message N/A N/A exit 1 N/A main N/A N/A N/A N/A N/A 
    Wrapper main function that handles broken pipes and keyboard interrupts.
     N/A N/A N/A N/A N/A signal signal N/A signal SIGPIPE N/A N/A N/A signum frame N/A N/A N/A sys exit 1 N/A N/A N/A AttributeError N/A N/A N/A N/A N/A N/A _main N/A N/A N/A KeyboardInterrupt N/A N/A N/A exit 1 N/A