Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias TryExcept body Import alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call NameLoad NameLoad keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword BinOpMult Num Str keyword BinOpMult Num Str keyword Num Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Assign NameStore Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad If NameLoad body AugAssignAdd NameStore BinOpAdd Str NameLoad Raise Call NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword TupleLoad Str Str keyword Num Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Assign NameStore Call NameLoad NameLoad If CompareNotEq NameLoad NameLoad body If CompareEq NameLoad Str body With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad Str orelse Raise Call NameLoad Str orelse If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword ListLoad Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num For NameStore AttributeLoad NameLoad attr body TryExcept body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad Call NameLoad NameLoad Assign NameStore Num Return NameLoad decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A 

Usage:
    jsoncheck.py [-f] FILES

Checks JSON syntax and optionally reformats (pretty-prints) the valid files.

Optional:
    - demjson Python library (better diagnostics for invalid JSON synax)

 __future__ print_function N/A argparse N/A collections N/A json N/A sys N/A textwrap N/A N/A N/A demjson N/A N/A N/A ImportError N/A N/A demjson None N/A N/A N/A N/A sys stderr write Cannot import the demjson Python module. Diagnostics for invalid JSON files
will be limited.
 check_syntax N/A N/A path N/A N/A N/A Check syntax of one JSON file. N/A N/A _process_file path N/A check_formatting N/A N/A path N/A N/A N/A Check formatting of one JSON file. N/A N/A _process_file path formatting check N/A fix_formatting N/A N/A path verbose N/A False N/A N/A Fix formatting of one JSON file. N/A N/A _process_file path formatting fix verbose verbose N/A _indent_note N/A N/A note N/A N/A N/A Indents and wraps a string. N/A indented_note N/A N/A line N/A N/A note splitlines N/A N/A N/A N/A indented_note append N/A N/A textwrap fill line initial_indent N/A 4 subsequent_indent N/A 12 width 80 N/A N/A N/A join indented_note N/A _get_demjson_diagnostics N/A N/A raw N/A N/A N/A Get diagnostics string for invalid JSON files from demjson. N/A errstr None N/A N/A N/A N/A N/A demjson decode raw strict True N/A N/A N/A N/A demjson JSONError N/A err N/A N/A errstr N/A N/A err pretty_description N/A errstr N/A ParserException N/A Exception N/A N/A N/A _parse_json N/A N/A raw N/A N/A N/A Parse raw JSON file. N/A N/A N/A parsed N/A N/A json loads raw object_pairs_hook N/A collections OrderedDict N/A N/A N/A ValueError N/A err N/A N/A note N/A str err N/A demjson N/A N/A demerr N/A _get_demjson_diagnostics raw N/A demerr N/A N/A note N/A demerr N/A N/A ParserException note N/A N/A parsed N/A _format_parsed_json N/A N/A parsed N/A N/A N/A Pretty-print JSON file content while retaining key order. N/A N/A N/A N/A json dumps parsed sort_keys False separators N/A , :  indent 4 N/A _process_file N/A N/A path formatting verbose N/A None False N/A N/A Check syntax/formatting and fix formatting of a JSON file.

    :param formatting: one of 'check' or 'fix' (default: None)

    Raises ValueError if JSON syntax is invalid or reformatting needed.
     N/A N/A open path r infile N/A N/A raw N/A N/A infile read N/A N/A N/A parsed N/A _parse_json raw N/A N/A N/A ParserException N/A err N/A N/A N/A ValueError err N/A N/A N/A formatting N/A check fix N/A N/A formatted N/A _format_parsed_json parsed N/A N/A formatted raw N/A N/A N/A formatting fix N/A N/A N/A open path w outfile N/A N/A N/A N/A outfile write formatted N/A verbose N/A N/A N/A print N/A %s
%s N/A path N/A _indent_note Reformatted N/A N/A N/A ValueError Reformatting needed N/A N/A N/A formatting None N/A N/A N/A ValueError Called with invalid formatting value. N/A main N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser description Validate and reformat JSONfiles. N/A N/A N/A parser add_argument files metavar FILES nargs + N/A N/A N/A parser add_argument -f --formatting choices N/A check fix help check or fix formatting of JSON files N/A args N/A N/A parser parse_args N/A exit_status 0 N/A path N/A args files N/A N/A N/A N/A N/A _process_file path N/A args formatting verbose True N/A N/A N/A ValueError N/A err N/A N/A N/A print N/A %s
%s N/A path N/A _indent_note N/A str err N/A exit_status 1 N/A exit_status N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main