jmespath.py
                                
                                
                                
                                    jmespath.py copied to clipboard
                            
                            
                            
                        JMESPath is a query language for JSON.
Hello, is there a syntax in order to specify to look for a key in the whole data structure? For example in JSONPath I can execute `$.sections[*]..item` The double dots...
Use case: Given [ {"type":"large","ip":"10.0.0.1"}, {"type":"large","ip":"10.0.0.2"}, {"type":"small","ip":"10.0.0.3"} ] I'd like to create: { "large": [{"type":"large","ip":"10.0.0.1"},{"type":"large","ip":"10.0.0.2"}], "small":[{"type":"small","ip":"10.0.0.3"}] } Is there any query expression to do it? Thanks very much.
I can't figure out how to declare a key in my custom JSON object with spaces in the name: ``` > aws ec2 describe-instances --query "Reservations[].Instances[].{Name: Tags[?Key == 'Name'].Value |...
Python3 implemented [PEP-238](https://peps.python.org/pep-0238/) which changes the way the division operator is applyied. In Python3 is not needed a float casting to get the result of a "true division" rather than...
Hello, First and foremost, thanks in advance for sharing JMESPath. It is very powerful especially it is used in ansible, which makes it very simple when querying or creating specified...
e.g. ``` book.p[content =~ /^pica+$/i] ```
Just copy of issue opened by @biochimia: https://github.com/jmespath/jmespath.site/issues/35 I propose the addition of a split() function, counterpart to the already standard join() function. split breaks a string into an array...
``` import jmespath a_work = [[{"a": 1}, {"b": 2}]] a_not_work = list(zip([{"a": 1}], [{"b": 2}])) # jmespath cannot be applied to zipped result assert a_not_work == [({"a": 1}, {"b": 2})]...
See also https://github.com/jmespath/jmespath.py/pull/180 This commit covers more use cases where tuples were not handled either and also provides test coverage. This change needs considering what should be the type of...
implements jmespath/jmespath.jep#20 I think `to_object` may need additional input checking, but I'm not sure what the behavior should be for some error cases. For example, `to_object(`[[1, 2, 3]]`)` will raise...