jsonpointer 3.2.0__py3-none-any.whl → 3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jsonpointer-3.2.0.data → jsonpointer-3.3.data}/scripts/jsonpointer +16 -4
- {jsonpointer-3.2.0.dist-info → jsonpointer-3.3.dist-info}/METADATA +5 -4
- jsonpointer-3.3.dist-info/RECORD +8 -0
- jsonpointer.py +2 -2
- jsonpointer-3.2.0.dist-info/RECORD +0 -8
- {jsonpointer-3.2.0.dist-info → jsonpointer-3.3.dist-info}/WHEEL +0 -0
- {jsonpointer-3.2.0.dist-info → jsonpointer-3.3.dist-info}/licenses/AUTHORS +0 -0
- {jsonpointer-3.2.0.dist-info → jsonpointer-3.3.dist-info}/licenses/LICENSE.txt +0 -0
- {jsonpointer-3.2.0.dist-info → jsonpointer-3.3.dist-info}/top_level.txt +0 -0
|
@@ -27,6 +27,8 @@ parser.add_argument('FILE', type=str, nargs='+',
|
|
|
27
27
|
help='Files for which the pointer should be resolved')
|
|
28
28
|
parser.add_argument('--indent', type=int, default=None,
|
|
29
29
|
help='Indent output by n spaces')
|
|
30
|
+
parser.add_argument('--continue-on-error', action='store_true',
|
|
31
|
+
help='Continue with remaining files after JSON or text decoding errors')
|
|
30
32
|
parser.add_argument('-v', '--version', action='version',
|
|
31
33
|
version='%(prog)s ' + jsonpointer.__version__)
|
|
32
34
|
|
|
@@ -55,7 +57,8 @@ def parse_pointer(args):
|
|
|
55
57
|
if args.pointer is not None:
|
|
56
58
|
ptr = args.pointer
|
|
57
59
|
else:
|
|
58
|
-
|
|
60
|
+
# 2026-10-11: Trim file line endings without changing member names.
|
|
61
|
+
ptr = args.pointer_file.read().rstrip("\r\n")
|
|
59
62
|
|
|
60
63
|
elif args.POINTER is not None:
|
|
61
64
|
ptr = args.POINTER
|
|
@@ -76,8 +79,8 @@ def parse_pointer(args):
|
|
|
76
79
|
def resolve_files():
|
|
77
80
|
""" Resolve a JSON pointer on JSON files
|
|
78
81
|
|
|
79
|
-
Returns False if the pointer could not be resolved on at least one
|
|
80
|
-
|
|
82
|
+
Returns False if the pointer could not be resolved on at least one file,
|
|
83
|
+
or if --continue-on-error skipped a JSON or text decoding error. """
|
|
81
84
|
args = parser.parse_args()
|
|
82
85
|
|
|
83
86
|
ptr, files = parse_pointer(args)
|
|
@@ -89,7 +92,16 @@ def resolve_files():
|
|
|
89
92
|
except argparse.ArgumentTypeError as e:
|
|
90
93
|
parser.error(str(e))
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
try:
|
|
96
|
+
doc = json.load(f)
|
|
97
|
+
except (json.JSONDecodeError, UnicodeDecodeError) as e:
|
|
98
|
+
if not args.continue_on_error:
|
|
99
|
+
raise
|
|
100
|
+
print('Could not parse JSON in %r: %s' % (name, e),
|
|
101
|
+
file=sys.stderr)
|
|
102
|
+
ok = False
|
|
103
|
+
continue
|
|
104
|
+
|
|
93
105
|
try:
|
|
94
106
|
result = jsonpointer.resolve_pointer(doc, ptr)
|
|
95
107
|
print(json.dumps(result, indent=args.indent))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonpointer
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3
|
|
4
4
|
Summary: Identify specific nodes in a JSON document (RFC 6901)
|
|
5
5
|
Home-page: https://github.com/stefankoegl/python-json-pointer
|
|
6
6
|
Author: Stefan Kögl
|
|
@@ -42,7 +42,8 @@ python-json-pointer
|
|
|
42
42
|
|
|
43
43
|
[](https://pypi.python.org/pypi/jsonpointer/)
|
|
44
44
|
[](https://pypi.python.org/pypi/jsonpointer/)
|
|
45
|
-
[](https://github.com/stefankoegl/python-json-pointer/actions/workflows/test.yaml)
|
|
46
|
+
[](https://coveralls.io/github/stefankoegl/python-json-pointer?branch=master)
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
Resolve JSON Pointers in Python
|
|
@@ -56,5 +57,5 @@ See source code for examples
|
|
|
56
57
|
* Repository: https://github.com/stefankoegl/python-json-pointer.git
|
|
57
58
|
* Documentation: https://python-json-pointer.readthedocs.org/
|
|
58
59
|
* PyPI: https://pypi.python.org/pypi/jsonpointer
|
|
59
|
-
*
|
|
60
|
-
* Coveralls: https://coveralls.io/
|
|
60
|
+
* GitHub Actions: https://github.com/stefankoegl/python-json-pointer/actions
|
|
61
|
+
* Coveralls: https://coveralls.io/github/stefankoegl/python-json-pointer
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
jsonpointer.py,sha256=EP3Tqu3L7k30O6WXgH1K97fNTQfyut89wNgu9D98XkE,11404
|
|
2
|
+
jsonpointer-3.3.data/scripts/jsonpointer,sha256=aMNUGc0Tro2UnAFF_k3NKKnOovSVBJ8ZOpigcaow97M,3545
|
|
3
|
+
jsonpointer-3.3.dist-info/licenses/AUTHORS,sha256=TVgxnQ9ZyHvvWwez_k2w8ZwtfVVFsDTGv3tXyJu-9X8,113
|
|
4
|
+
jsonpointer-3.3.dist-info/licenses/LICENSE.txt,sha256=2LJPFdRyiF94ii1umFhQ8mRie4YBKhe7JCyD8xDZB-U,1413
|
|
5
|
+
jsonpointer-3.3.dist-info/METADATA,sha256=_PwKqjWIvep78J6TFDos4EnRNEfzewDKkEXT5L6klEg,2638
|
|
6
|
+
jsonpointer-3.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
7
|
+
jsonpointer-3.3.dist-info/top_level.txt,sha256=BsUcar_C0nZzPGV2ackrJ9CpVU8_0W_pHYKwpdnWddM,12
|
|
8
|
+
jsonpointer-3.3.dist-info/RECORD,,
|
jsonpointer.py
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
# Will be parsed by setup.py to determine package metadata
|
|
34
34
|
__author__ = 'Stefan Kögl <stefan@skoegl.net>'
|
|
35
|
-
__version__ = '3.
|
|
35
|
+
__version__ = '3.3'
|
|
36
36
|
__website__ = 'https://github.com/stefankoegl/python-json-pointer'
|
|
37
37
|
__license__ = 'Modified BSD License'
|
|
38
38
|
|
|
@@ -307,7 +307,7 @@ class JsonPointer:
|
|
|
307
307
|
suffix_parts = suffix
|
|
308
308
|
try:
|
|
309
309
|
return self.__class__.from_parts(chain(self.parts, suffix_parts))
|
|
310
|
-
except:
|
|
310
|
+
except Exception:
|
|
311
311
|
raise JsonPointerException("Invalid suffix")
|
|
312
312
|
|
|
313
313
|
def __truediv__(self, suffix):
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
jsonpointer.py,sha256=80Ru4-pIHwq5TveZVxIJqp_oqoH3l4qtBabY95AtQJc,11409
|
|
2
|
-
jsonpointer-3.2.0.data/scripts/jsonpointer,sha256=tXI8Sl-uL_RDnd7mVTa3HzabsesBybpV2gDcAfpXI0g,2946
|
|
3
|
-
jsonpointer-3.2.0.dist-info/licenses/AUTHORS,sha256=TVgxnQ9ZyHvvWwez_k2w8ZwtfVVFsDTGv3tXyJu-9X8,113
|
|
4
|
-
jsonpointer-3.2.0.dist-info/licenses/LICENSE.txt,sha256=2LJPFdRyiF94ii1umFhQ8mRie4YBKhe7JCyD8xDZB-U,1413
|
|
5
|
-
jsonpointer-3.2.0.dist-info/METADATA,sha256=suE0BGiuliMr42SMgsqVgdGNXYSJCF44D5m3NlZENGM,2418
|
|
6
|
-
jsonpointer-3.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
7
|
-
jsonpointer-3.2.0.dist-info/top_level.txt,sha256=BsUcar_C0nZzPGV2ackrJ9CpVU8_0W_pHYKwpdnWddM,12
|
|
8
|
-
jsonpointer-3.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|