jsonutils#
- aws_ops_alpha.vendor.jsonutils.strip_comment_line_with_symbol(line: str, comment_symbol: str)[source]#
Strip comments from line string.
- Parameters:
line – the single line string that you want to strip out comments.
comment_symbol – the comment char that indicate that the comment starts from.
- aws_ops_alpha.vendor.jsonutils.strip_comments(text: str, comment_symbols=frozenset({'#', '//'}))[source]#
Strip comments from json string.
- Parameters:
text – A string containing json with comments started by comment_symbols.
comment_symbols – Iterable of symbols that start a line comment (default # or //).
- Returns:
The string with the comments removed.
- aws_ops_alpha.vendor.jsonutils.json_loads(text: str, ignore_comments: bool = True)[source]#
Load Json from string. But this function can ignore comments.
Valid commands are:
# this is a comment { "a": 1 // this is a comment }
- Parameters:
text – the json string.
ignore_comments – whether or not to ignore comments.