You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a7974cf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ pipx install python-jsonpath
89
89
90
90
Find all objects in `data` matching the given JSONPath `path`. If data is a string, it will be loaded using `json.loads()` and the default `JSONDecoder`.
91
91
92
-
Returns a list of matched objects, or an empty list if there were not matches.
92
+
Returns a list of matched objects, or an empty list if there were no matches.
93
93
94
94
### jsonpath.finditer
95
95
@@ -103,11 +103,11 @@ Return an iterator yielding a `JSONPathMatch` instance for each match of the `pa
103
103
104
104
Prepare a path for repeated matching against different data. `jsonpath.findall()` and `jsonpath.finditer()` are convenience functions that call `compile()` for you.
105
105
106
-
`JSONPath` and `CompoundJSONPath` both have `findall()` and `finditer()` methods that behave the same as `jsonpath.findall()` and `jsonpath.finditer()`, just without taking a path string argument.
106
+
`JSONPath` and `CompoundJSONPath` both have `findall()` and `finditer()` methods that behave the same as `jsonpath.findall()` and `jsonpath.finditer()`, just without the path argument.
107
107
108
108
### async
109
109
110
-
`findall_async()` and `finditer_async` are async equivalents of `findall()` and `finditer()`. They are used when integrating Python JSONPath with [Python Liquid](https://github.com/jg-rp/liquid) and use Python Liquid's [async protocol](https://jg-rp.github.io/liquid/introduction/async-support).
110
+
`findall_async()` and `finditer_async()` are async equivalents of `findall()` and `finditer()`. They are used when integrating Python JSONPath with [Python Liquid](https://github.com/jg-rp/liquid) and use Python Liquid's [async protocol](https://jg-rp.github.io/liquid/introduction/async-support).
111
111
112
112
### Extra filter context
113
113
@@ -119,7 +119,7 @@ Use `#` to query extra filter data, similar to how one might use `@` or `$`.
119
119
120
120
Python JSONPath's default syntax is an opinionated combination of JSONPath features from existing, popular implementations, and much of the [IETF JSONPath draft](https://datatracker.ietf.org/doc/html/draft-ietf-jsonpath-base-11). If you're already familiar with JSONPath syntax, skip to [notable differences](#notable-differences).
121
121
122
-
TODO: tree analogy / target document
122
+
TODO: tree analogy / target document
123
123
TODO: use "node" terminology
124
124
TODO: mention JSON and Python equivalency
125
125
@@ -235,7 +235,7 @@ Comparison operators include `==`, `!=`, `<`, `>`, `<=` and `>=`. Plus `<>` as a
235
235
236
236
`&&` and `||` are logical operators, `and` and `or` work too.
237
237
238
-
`=~` matches the left value with a regular expression literal. Regular expressions use a similar syntax to that found in JavaScript, where the pattern to match is surrounded by slashes, optionally followed by flags.
238
+
`=~` matches the left value with a regular expression literal. Regular expressions use a syntax similar to that found in JavaScript, where the pattern to match is surrounded by slashes, optionally followed by flags.
239
239
240
240
```text
241
241
$..products.*[?(@.description =~ /.*trainers/i)]
@@ -263,7 +263,7 @@ And this is a list of areas where we deviate from the [IETF JSONPath draft](http
263
263
- Nested filters are not supported.
264
264
- When a filter is applied to an object (mapping) value, we do not silently apply that filter to the object's values. See the "Existence of non-singular queries" example in the IETF JSONPath draft.
265
265
-`|` is a union operator, where matches from two or more JSONPaths are combined.
266
-
-`&` is an intersection operator, where we output matches that exist in two paths.
266
+
-`&` is an intersection operator, where we exclude matches that don't exist in both left and right paths.
0 commit comments