Open gramscih opened 4 years ago
This should be fixed in v1.5.1
.
Hi! Any news on this?
Can you upgrade to latest version from PyPi?
pip install --upgrade jsonpath-ng
@h2non still not working, what was the merged of fix please? raise Exception('Parse error at %s:%s near token %s (%s)' % (t.lineno, t.col, t.value, t.type)) Exception: Parse error at 1:3 near token ~ (~)
from jsonpath_ng.ext import parse
json_path_expression = parse("$.*~") matches = json_path_expression.find(json) for match in matches: print(match.value)
@GramsciH @XPi2 any solutions please?
@h2non @gramscih sorry for bothering, is there any update? maybe is there custom patch?
When I am trying to obtain the keys from this json
json = { "ens33": { "flags": "4163<UP,BROADCAST,RUNNING,MULTICAST>", "mtu": "1500", "inet": "10.2.10.36", "netmask": "255.255.255.0", "broadcast": "10.2.10.255" }, "lo": { "flags": "73<UP,LOOPBACK,RUNNING>", "mtu": "65536", "inet": "127.0.0.1", "netmask": "255.0.0.0", "inet6": "::1", "prefixlen": "128", } }
with the following code
keys = parse("$.*~").find(json)
Expected result["ens33", "lo"]
But I have this error jsonpath_ng.lexer.JsonPathLexerError: Error on line 1, col 3: Unexpected character: ~
some workaround to obtain the keys from json?
Thanks in advance