File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 48
48
49
49
The ``jmespath.py `` library has two functions
50
50
that operate on python data structures. You can use ``search ``
51
- and give it the jmespath expression and the data::
51
+ and give it the jmespath expression and the data:
52
+
53
+ .. code :: python
52
54
53
55
>> > import jmespath
54
56
>> > path = jmespath.search(' foo.bar' , {' foo' : {' bar' : ' baz' }})
55
57
' baz'
56
58
57
59
Similar to the ``re `` module, you can use the ``compile `` function
58
60
to compile the JMESPath expression and use this parsed expression
59
- to perform repeated searches::
61
+ to perform repeated searches:
62
+
63
+ .. code :: python
60
64
61
65
>> > import jmespath
62
66
>> > expression = jmespath.compile(' foo.bar' )
@@ -75,7 +79,9 @@ Options
75
79
You can provide an instance of ``jmespath.Options `` to control how
76
80
a JMESPath expression is evaluated. The most common scenario for
77
81
using an ``Options `` instance is if you want to have ordered output
78
- of your dict keys. To do this you can use either of these options::
82
+ of your dict keys. To do this you can use either of these options:
83
+
84
+ .. code :: python
79
85
80
86
>> > import jmespath
81
87
>> > jmespath.search(' {a: a, b: b} ,
You can’t perform that action at this time.
0 commit comments