jsonpointer 3.0.0__tar.gz → 3.1.1__tar.gz
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.0.0/jsonpointer.egg-info → jsonpointer-3.1.1}/PKG-INFO +15 -6
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/bin/jsonpointer +1 -2
- {jsonpointer-3.0.0 → jsonpointer-3.1.1/jsonpointer.egg-info}/PKG-INFO +15 -6
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/jsonpointer.py +5 -7
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/setup.cfg +0 -3
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/setup.py +17 -17
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/tests.py +23 -35
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/AUTHORS +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/LICENSE.txt +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/MANIFEST.in +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/README.md +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/jsonpointer.egg-info/SOURCES.txt +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/jsonpointer.egg-info/dependency_links.txt +0 -0
- {jsonpointer-3.0.0 → jsonpointer-3.1.1}/jsonpointer.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonpointer
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.1
|
|
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
|
|
@@ -13,20 +13,29 @@ Classifier: License :: OSI Approved :: BSD License
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
23
22
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
24
23
|
Classifier: Topic :: Software Development :: Libraries
|
|
25
24
|
Classifier: Topic :: Utilities
|
|
26
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.10
|
|
27
26
|
Description-Content-Type: text/markdown
|
|
28
27
|
License-File: LICENSE.txt
|
|
29
28
|
License-File: AUTHORS
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: description-content-type
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
Dynamic: summary
|
|
30
39
|
|
|
31
40
|
python-json-pointer
|
|
32
41
|
===================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonpointer
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.1
|
|
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
|
|
@@ -13,20 +13,29 @@ Classifier: License :: OSI Approved :: BSD License
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
23
22
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
24
23
|
Classifier: Topic :: Software Development :: Libraries
|
|
25
24
|
Classifier: Topic :: Utilities
|
|
26
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.10
|
|
27
26
|
Description-Content-Type: text/markdown
|
|
28
27
|
License-File: LICENSE.txt
|
|
29
28
|
License-File: AUTHORS
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: description-content-type
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
Dynamic: summary
|
|
30
39
|
|
|
31
40
|
python-json-pointer
|
|
32
41
|
===================
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
1
|
# python-json-pointer - An implementation of the JSON Pointer syntax
|
|
4
2
|
# https://github.com/stefankoegl/python-json-pointer
|
|
5
3
|
#
|
|
@@ -34,7 +32,7 @@
|
|
|
34
32
|
|
|
35
33
|
# Will be parsed by setup.py to determine package metadata
|
|
36
34
|
__author__ = 'Stefan Kögl <stefan@skoegl.net>'
|
|
37
|
-
__version__ = '3.
|
|
35
|
+
__version__ = '3.1.1'
|
|
38
36
|
__website__ = 'https://github.com/stefankoegl/python-json-pointer'
|
|
39
37
|
__license__ = 'Modified BSD License'
|
|
40
38
|
|
|
@@ -136,7 +134,7 @@ class JsonPointerException(Exception):
|
|
|
136
134
|
pass
|
|
137
135
|
|
|
138
136
|
|
|
139
|
-
class EndOfList
|
|
137
|
+
class EndOfList:
|
|
140
138
|
"""Result of accessing element "-" of a list"""
|
|
141
139
|
|
|
142
140
|
def __init__(self, list_):
|
|
@@ -147,7 +145,7 @@ class EndOfList(object):
|
|
|
147
145
|
lst=repr(self.list_))
|
|
148
146
|
|
|
149
147
|
|
|
150
|
-
class JsonPointer
|
|
148
|
+
class JsonPointer:
|
|
151
149
|
"""A JSON Pointer that can reference parts of a JSON document"""
|
|
152
150
|
|
|
153
151
|
# Array indices must not contain:
|
|
@@ -230,7 +228,7 @@ class JsonPointer(object):
|
|
|
230
228
|
if part == '-':
|
|
231
229
|
return part
|
|
232
230
|
|
|
233
|
-
if not JsonPointer._RE_ARRAY_INDEX.
|
|
231
|
+
if not JsonPointer._RE_ARRAY_INDEX.fullmatch(str(part)):
|
|
234
232
|
raise JsonPointerException("'%s' is not a valid sequence index" % part)
|
|
235
233
|
|
|
236
234
|
return int(part)
|
|
@@ -294,7 +292,7 @@ class JsonPointer(object):
|
|
|
294
292
|
except: # noqa E722
|
|
295
293
|
raise JsonPointerException("Invalid suffix")
|
|
296
294
|
|
|
297
|
-
def __truediv__(self, suffix):
|
|
295
|
+
def __truediv__(self, suffix):
|
|
298
296
|
return self.join(suffix)
|
|
299
297
|
|
|
300
298
|
@property
|
|
@@ -38,29 +38,29 @@ CLASSIFIERS = [
|
|
|
38
38
|
'Operating System :: OS Independent',
|
|
39
39
|
'Programming Language :: Python',
|
|
40
40
|
'Programming Language :: Python :: 3',
|
|
41
|
-
'Programming Language :: Python :: 3.7',
|
|
42
|
-
'Programming Language :: Python :: 3.8',
|
|
43
|
-
'Programming Language :: Python :: 3.9',
|
|
44
41
|
'Programming Language :: Python :: 3.10',
|
|
45
42
|
'Programming Language :: Python :: 3.11',
|
|
46
43
|
'Programming Language :: Python :: 3.12',
|
|
44
|
+
'Programming Language :: Python :: 3.13',
|
|
45
|
+
'Programming Language :: Python :: 3.14',
|
|
47
46
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
48
47
|
'Programming Language :: Python :: Implementation :: PyPy',
|
|
49
48
|
'Topic :: Software Development :: Libraries',
|
|
50
49
|
'Topic :: Utilities',
|
|
51
50
|
]
|
|
52
51
|
|
|
53
|
-
setup(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
setup(
|
|
53
|
+
name=PACKAGE,
|
|
54
|
+
version=VERSION,
|
|
55
|
+
description=DESCRIPTION,
|
|
56
|
+
long_description=long_description,
|
|
57
|
+
long_description_content_type="text/markdown",
|
|
58
|
+
author=AUTHOR,
|
|
59
|
+
author_email=EMAIL,
|
|
60
|
+
license=LICENSE,
|
|
61
|
+
url=WEBSITE,
|
|
62
|
+
py_modules=MODULES,
|
|
63
|
+
scripts=['bin/jsonpointer'],
|
|
64
|
+
classifiers=CLASSIFIERS,
|
|
65
|
+
python_requires='>=3.10',
|
|
66
|
+
)
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
from __future__ import unicode_literals
|
|
5
2
|
|
|
6
3
|
import copy
|
|
7
4
|
import doctest
|
|
8
|
-
import sys
|
|
9
5
|
import unittest
|
|
10
6
|
|
|
11
7
|
import jsonpointer
|
|
@@ -78,45 +74,33 @@ class SpecificationTests(unittest.TestCase):
|
|
|
78
74
|
|
|
79
75
|
def test_str_and_repr(self):
|
|
80
76
|
paths = [
|
|
81
|
-
("", "", "JsonPointer(
|
|
82
|
-
("/foo", "/foo", "JsonPointer(
|
|
83
|
-
("/foo/0", "/foo/0", "JsonPointer(
|
|
84
|
-
("/", "/", "JsonPointer(
|
|
85
|
-
("/a~1b", "/a~1b", "JsonPointer(
|
|
86
|
-
("/c%d", "/c%d", "JsonPointer(
|
|
87
|
-
("/e^f", "/e^f", "JsonPointer(
|
|
88
|
-
("/g|h", "/g|h", "JsonPointer(
|
|
89
|
-
("/i\\j", "/i\\j", "JsonPointer(
|
|
90
|
-
("/k\"l", "/k\"l", "JsonPointer(
|
|
91
|
-
("/ ", "/ ", "JsonPointer(
|
|
92
|
-
("/m~0n", "/m~0n", "JsonPointer(
|
|
77
|
+
("", "", "JsonPointer('')"),
|
|
78
|
+
("/foo", "/foo", "JsonPointer('/foo')"),
|
|
79
|
+
("/foo/0", "/foo/0", "JsonPointer('/foo/0')"),
|
|
80
|
+
("/", "/", "JsonPointer('/')"),
|
|
81
|
+
("/a~1b", "/a~1b", "JsonPointer('/a~1b')"),
|
|
82
|
+
("/c%d", "/c%d", "JsonPointer('/c%d')"),
|
|
83
|
+
("/e^f", "/e^f", "JsonPointer('/e^f')"),
|
|
84
|
+
("/g|h", "/g|h", "JsonPointer('/g|h')"),
|
|
85
|
+
("/i\\j", "/i\\j", "JsonPointer('/i\\\\j')"),
|
|
86
|
+
("/k\"l", "/k\"l", "JsonPointer('/k\"l')"),
|
|
87
|
+
("/ ", "/ ", "JsonPointer('/ ')"),
|
|
88
|
+
("/m~0n", "/m~0n", "JsonPointer('/m~0n')"),
|
|
93
89
|
]
|
|
94
90
|
for path, ptr_str, ptr_repr in paths:
|
|
95
91
|
ptr = JsonPointer(path)
|
|
96
92
|
self.assertEqual(path, ptr.path)
|
|
97
|
-
|
|
98
|
-
if sys.version_info[0] == 2:
|
|
99
|
-
u_str = "u"
|
|
100
|
-
else:
|
|
101
|
-
u_str = ""
|
|
102
93
|
self.assertEqual(ptr_str, str(ptr))
|
|
103
|
-
self.assertEqual(ptr_repr
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
ptr_repr = "JsonPointer(u'/\\xee')"
|
|
109
|
-
else:
|
|
110
|
-
path = "/\xee"
|
|
111
|
-
ptr_str = "/\xee"
|
|
112
|
-
ptr_repr = "JsonPointer('/\xee')"
|
|
94
|
+
self.assertEqual(ptr_repr, repr(ptr))
|
|
95
|
+
|
|
96
|
+
path = "/\xee"
|
|
97
|
+
ptr_str = "/\xee"
|
|
98
|
+
ptr_repr = "JsonPointer('/\xee')"
|
|
113
99
|
ptr = JsonPointer(path)
|
|
114
100
|
self.assertEqual(path, ptr.path)
|
|
115
|
-
|
|
116
101
|
self.assertEqual(ptr_str, str(ptr))
|
|
117
102
|
self.assertEqual(ptr_repr, repr(ptr))
|
|
118
103
|
|
|
119
|
-
# should not be unicode in Python 2
|
|
120
104
|
self.assertIsInstance(str(ptr), str)
|
|
121
105
|
self.assertIsInstance(repr(ptr), str)
|
|
122
106
|
|
|
@@ -231,6 +215,10 @@ class WrongInputTests(unittest.TestCase):
|
|
|
231
215
|
def test_invalid_escape(self):
|
|
232
216
|
self.assertRaises(JsonPointerException, JsonPointer, '/foo/bar~2')
|
|
233
217
|
|
|
218
|
+
def test_leading_zero(self):
|
|
219
|
+
doc = [0, 1, 2]
|
|
220
|
+
self.assertRaises(JsonPointerException, resolve_pointer, doc, '/01')
|
|
221
|
+
|
|
234
222
|
|
|
235
223
|
class ToLastTests(unittest.TestCase):
|
|
236
224
|
|
|
@@ -385,7 +373,7 @@ class AltTypesTests(unittest.TestCase):
|
|
|
385
373
|
'/root/1/2': '3',
|
|
386
374
|
}
|
|
387
375
|
|
|
388
|
-
for path, expected_value in
|
|
376
|
+
for path, expected_value in path_to_expected_value.items():
|
|
389
377
|
self.assertEqual(resolve_pointer(doc, path, default), expected_value)
|
|
390
378
|
|
|
391
379
|
def test_mock_dict_returns_default(self):
|
|
@@ -397,7 +385,7 @@ class AltTypesTests(unittest.TestCase):
|
|
|
397
385
|
'/x/y/z/d': default
|
|
398
386
|
}
|
|
399
387
|
|
|
400
|
-
for path, expected_value in
|
|
388
|
+
for path, expected_value in path_to_expected_value.items():
|
|
401
389
|
self.assertEqual(resolve_pointer(doc, path, default), expected_value)
|
|
402
390
|
|
|
403
391
|
def test_mock_dict_raises_key_error(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|