omnipy.components.json.helpers
Utility predicates and parsers for JSON-compatible values.
| FUNCTION | DESCRIPTION |
|---|---|
is_json_dict |
Return whether a JSON value is an object. |
is_json_list |
Return whether a JSON value is an array. |
is_json_scalar |
Return whether a JSON value is a scalar. |
parse_line_as_elements_of_dict |
Parse a line as the comma-separated contents of a JSON object. |
parse_line_as_elements_of_list |
Parse a line as the comma-separated contents of a JSON array. |
parse_str_as_json |
Parse a string as JSON, returning |
is_json_dict
is_json_list
is_json_scalar
is_json_scalar(json_val: Json) -> TypeIs[JsonScalar]
Return whether a JSON value is a scalar.
parse_line_as_elements_of_dict
parse_line_as_elements_of_dict(_line: str) -> JsonDict | pyd.UndefinedType
Parse a line as the comma-separated contents of a JSON object.
Source code in src/omnipy/components/json/helpers.py
parse_line_as_elements_of_list
parse_line_as_elements_of_list(_line: str) -> JsonList | pyd.UndefinedType
Parse a line as the comma-separated contents of a JSON array.
Source code in src/omnipy/components/json/helpers.py
parse_str_as_json
parse_str_as_json(_line: str) -> Json | pyd.UndefinedType
Parse a string as JSON, returning Undefined on failure.