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
--strict Compile and evaluate JSONPath expressions with strict compliance with RFC 9535.
65
66
```
66
67
67
68
## Global Options
@@ -191,6 +192,12 @@ _New in version 0.10.0_
191
192
192
193
Disables JSONPath filter expression well-typedness checks. The well-typedness of a filter expression is defined by RFC 9535.
193
194
195
+
#### `--strict`
196
+
197
+
_New in version 2.0.0_
198
+
199
+
Compile and evaluate JSONPath expressions with strict compliance with RFC 9535.
200
+
194
201
### `pointer`
195
202
196
203
Resolve a JSON Pointer against a JSON document. One of `-p`/`--pointer` or `-r`/`--pointer-file` must be given. `-p` being a JSON Pointer given on the command line as a string, `-r` being the path to a file containing a JSON Pointer.
These package-level functions use the default [JSONPathEnvironment](api.md#jsonpath.JSONPathEnvironment), `jsonpath.DEFAULT_ENV` when `strict=False`, or the preconfigured strict environment, `jsonpath.STRICT_ENV` when `strict=True`.
Copy file name to clipboardExpand all lines: docs/quickstart.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,18 @@ This page gets you started using JSONPath, JSON Pointer and JSON Patch wih Pytho
4
4
5
5
## `findall(path, data)`
6
6
7
-
Find all values matching a JSONPath query using [`jsonpath.findall()`](api.md#jsonpath.JSONPathEnvironment.findall).
7
+
Find all values matching a JSONPath query using [`jsonpath.findall()`](convenience.md#jsonpath.findall).
8
8
9
9
This function takes two arguments:
10
10
11
-
-`path`: a JSONPath query as a string (e.g.,`"$.users[*].name"`)
11
+
-`path`: a JSONPath query as a string (e.g. `"$.users[*].name"`)
12
12
-`data`: the JSON document to query
13
13
14
14
It **always** returns a list of matched values, even if the path resolves to a single result or nothing at all.
15
15
16
16
The `data` argument can be:
17
17
18
-
- A Python [`Mapping`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping) (e.g.,`dict`) or [`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence) (e.g.,`list`)
18
+
- A Python [`Mapping`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping) (e.g. `dict`) or [`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence) (e.g. `list`)
19
19
- A JSON-formatted string
20
20
- A file-like object containing JSON
21
21
@@ -65,7 +65,7 @@ with open("users.json") as fd:
65
65
66
66
## `finditer(path, data)`
67
67
68
-
Use [`jsonpath.finditer()`](api.md#jsonpath.JSONPathEnvironment.finditer) to iterate over instances of [`jsonpath.JSONPathMatch`](api.md#jsonpath.JSONPathMatch) for every object in _data_ that matches _path_. It accepts the same arguments as [`findall()`](#findallpath-data), a query string and data from which to select matches.
68
+
Use [`jsonpath.finditer()`](convenience.md#jsonpath.finditer) to iterate over instances of [`jsonpath.JSONPathMatch`](api.md#jsonpath.JSONPathMatch) for every object in _data_ that matches _path_. It accepts the same arguments as [`findall()`](#findallpath-data), a query string and data from which to select matches.
69
69
70
70
```python
71
71
import jsonpath
@@ -109,7 +109,7 @@ The selected object is available from a [`JSONPathMatch`](api.md#jsonpath.JSONPa
109
109
110
110
## `compile(path)`
111
111
112
-
When you have a JSONPath query that needs to be matched against different data repeatedly, you can compile the path ahead of time using [`jsonpath.compile()`](api.md#jsonpath.JSONPathEnvironment.compile). It takes a query as a string and returns an instance of [`JSONPath`](api.md#jsonpath.JSONPath). `JSONPath` has `findall()` and `finditer()` methods that behave similarly to package-level `findall()` and `finditer()`, just without the `path` argument.
112
+
When you have a JSONPath query that needs to be matched against different data repeatedly, you can compile the path ahead of time using [`jsonpath.compile()`](convenience.md#jsonpath.compile). It takes a query as a string and returns an instance of [`JSONPath`](api.md#jsonpath.JSONPath). `JSONPath` has `findall()` and `finditer()` methods that behave similarly to package-level `findall()` and `finditer()`, just without the `path` argument.
0 commit comments