jsonpatch 1.32__tar.gz → 1.34__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.
- jsonpatch-1.34/LICENSE +11 -0
- jsonpatch-1.34/PKG-INFO +86 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/README.md +11 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/bin/jsondiff +3 -3
- {jsonpatch-1.32 → jsonpatch-1.34}/ext_tests.py +3 -3
- jsonpatch-1.34/jsonpatch.egg-info/PKG-INFO +86 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/jsonpatch.egg-info/SOURCES.txt +1 -2
- {jsonpatch-1.32 → jsonpatch-1.34}/jsonpatch.py +256 -195
- {jsonpatch-1.32 → jsonpatch-1.34}/setup.cfg +0 -3
- {jsonpatch-1.32 → jsonpatch-1.34}/setup.py +8 -19
- {jsonpatch-1.32 → jsonpatch-1.34}/tests.py +303 -20
- jsonpatch-1.32/COPYING +0 -26
- jsonpatch-1.32/PKG-INFO +0 -74
- jsonpatch-1.32/jsonpatch.egg-info/PKG-INFO +0 -74
- {jsonpatch-1.32 → jsonpatch-1.34}/AUTHORS +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/MANIFEST.in +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/bin/jsonpatch +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/jsonpatch.egg-info/dependency_links.txt +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/jsonpatch.egg-info/requires.txt +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/jsonpatch.egg-info/top_level.txt +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/requirements.txt +0 -0
- {jsonpatch-1.32 → jsonpatch-1.34}/tests.js +0 -0
jsonpatch-1.34/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright (c) 2011 Stefan Kögl <stefan@skoegl.net>
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
+
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
+
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
jsonpatch-1.34/PKG-INFO
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jsonpatch
|
|
3
|
+
Version: 1.34
|
|
4
|
+
Summary: Apply JSON-Patches (RFC 6902)
|
|
5
|
+
Home-page: https://github.com/stefankoegl/python-json-patch
|
|
6
|
+
Author: Stefan Kögl
|
|
7
|
+
Author-email: stefan@skoegl.net
|
|
8
|
+
License: Modified BSD License
|
|
9
|
+
Project-URL: Website, https://github.com/stefankoegl/python-json-patch
|
|
10
|
+
Project-URL: Repository, https://github.com/stefankoegl/python-json-patch.git
|
|
11
|
+
Project-URL: Documentation, https://python-json-patch.readthedocs.org/
|
|
12
|
+
Project-URL: PyPI, https://pypi.org/pypi/jsonpatch
|
|
13
|
+
Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
|
|
14
|
+
Project-URL: Test Coverage, https://coveralls.io/r/stefankoegl/python-json-patch
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
27
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
28
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
29
|
+
Classifier: Topic :: Utilities
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
License-File: AUTHORS
|
|
34
|
+
Requires-Dist: jsonpointer>=1.9
|
|
35
|
+
Dynamic: author
|
|
36
|
+
Dynamic: author-email
|
|
37
|
+
Dynamic: classifier
|
|
38
|
+
Dynamic: description
|
|
39
|
+
Dynamic: description-content-type
|
|
40
|
+
Dynamic: home-page
|
|
41
|
+
Dynamic: license
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
Dynamic: project-url
|
|
44
|
+
Dynamic: requires-dist
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
Dynamic: summary
|
|
47
|
+
|
|
48
|
+
python-json-patch
|
|
49
|
+
=================
|
|
50
|
+
|
|
51
|
+
[](https://pypi.python.org/pypi/jsonpatch/)
|
|
52
|
+
[](https://pypi.python.org/pypi/jsonpatch/)
|
|
53
|
+
[](https://travis-ci.org/stefankoegl/python-json-patch)
|
|
54
|
+
[](https://coveralls.io/r/stefankoegl/python-json-patch?branch=master)
|
|
55
|
+
|
|
56
|
+
Applying JSON Patches in Python
|
|
57
|
+
-------------------------------
|
|
58
|
+
|
|
59
|
+
Library to apply JSON Patches according to
|
|
60
|
+
[RFC 6902](http://tools.ietf.org/html/rfc6902)
|
|
61
|
+
|
|
62
|
+
See source code for examples
|
|
63
|
+
|
|
64
|
+
* Website: https://github.com/stefankoegl/python-json-patch
|
|
65
|
+
* Repository: https://github.com/stefankoegl/python-json-patch.git
|
|
66
|
+
* Documentation: https://python-json-patch.readthedocs.org/
|
|
67
|
+
* PyPI: https://pypi.python.org/pypi/jsonpatch
|
|
68
|
+
* Travis CI: https://travis-ci.org/stefankoegl/python-json-patch
|
|
69
|
+
* Coveralls: https://coveralls.io/r/stefankoegl/python-json-patch
|
|
70
|
+
|
|
71
|
+
Running external tests
|
|
72
|
+
----------------------
|
|
73
|
+
To run external tests (such as those from https://github.com/json-patch/json-patch-tests) use ext_test.py
|
|
74
|
+
|
|
75
|
+
./ext_tests.py ../json-patch-tests/tests.json
|
|
76
|
+
|
|
77
|
+
Running property-based tests
|
|
78
|
+
----------------------------
|
|
79
|
+
Property-based tests using [Hypothesis](https://hypothesis.readthedocs.io/)
|
|
80
|
+
are in property_tests.py. Properties that the implementation does not satisfy
|
|
81
|
+
yet are marked as expected failures.
|
|
82
|
+
|
|
83
|
+
pip install hypothesis
|
|
84
|
+
python property_tests.py
|
|
85
|
+
|
|
86
|
+
Set `HYPOTHESIS_PROFILE=thorough` to run many more examples.
|
|
@@ -26,3 +26,14 @@ Running external tests
|
|
|
26
26
|
To run external tests (such as those from https://github.com/json-patch/json-patch-tests) use ext_test.py
|
|
27
27
|
|
|
28
28
|
./ext_tests.py ../json-patch-tests/tests.json
|
|
29
|
+
|
|
30
|
+
Running property-based tests
|
|
31
|
+
----------------------------
|
|
32
|
+
Property-based tests using [Hypothesis](https://hypothesis.readthedocs.io/)
|
|
33
|
+
are in property_tests.py. Properties that the implementation does not satisfy
|
|
34
|
+
yet are marked as expected failures.
|
|
35
|
+
|
|
36
|
+
pip install hypothesis
|
|
37
|
+
python property_tests.py
|
|
38
|
+
|
|
39
|
+
Set `HYPOTHESIS_PROFILE=thorough` to run many more examples.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
|
-
from __future__ import print_function
|
|
5
|
-
|
|
6
4
|
import sys
|
|
7
5
|
import json
|
|
8
6
|
import jsonpatch
|
|
@@ -14,6 +12,8 @@ parser.add_argument('FILE1', type=argparse.FileType('r'))
|
|
|
14
12
|
parser.add_argument('FILE2', type=argparse.FileType('r'))
|
|
15
13
|
parser.add_argument('--indent', type=int, default=None,
|
|
16
14
|
help='Indent output by n spaces')
|
|
15
|
+
parser.add_argument('-u', '--preserve-unicode', action='store_true',
|
|
16
|
+
help='Output Unicode character as-is without using Code Point')
|
|
17
17
|
parser.add_argument('-v', '--version', action='version',
|
|
18
18
|
version='%(prog)s ' + jsonpatch.__version__)
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ def diff_files():
|
|
|
32
32
|
doc2 = json.load(args.FILE2)
|
|
33
33
|
patch = jsonpatch.make_patch(doc1, doc2)
|
|
34
34
|
if patch.patch:
|
|
35
|
-
print(json.dumps(patch.patch, indent=args.indent))
|
|
35
|
+
print(json.dumps(patch.patch, indent=args.indent, ensure_ascii=not(args.preserve_unicode)))
|
|
36
36
|
sys.exit(1)
|
|
37
37
|
|
|
38
38
|
if __name__ == "__main__":
|
|
@@ -65,9 +65,9 @@ class TestCaseTemplate(unittest.TestCase):
|
|
|
65
65
|
raise Exception(test.get('comment', '')) from jpe
|
|
66
66
|
|
|
67
67
|
# if there is no 'expected' we only verify that applying the patch
|
|
68
|
-
# does not
|
|
68
|
+
# does not raise an exception
|
|
69
69
|
if 'expected' in test:
|
|
70
|
-
self.
|
|
70
|
+
self.assertEqual(res, test['expected'], test.get('comment', ''))
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
def make_test_case(tests):
|
|
@@ -98,7 +98,7 @@ def get_suite(filenames):
|
|
|
98
98
|
# we use the (potentially) patched version of json.load here
|
|
99
99
|
tests = jsonpatch.json.load(f)
|
|
100
100
|
cls = make_test_case(tests)
|
|
101
|
-
suite.addTest(unittest.
|
|
101
|
+
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(cls))
|
|
102
102
|
|
|
103
103
|
return suite
|
|
104
104
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jsonpatch
|
|
3
|
+
Version: 1.34
|
|
4
|
+
Summary: Apply JSON-Patches (RFC 6902)
|
|
5
|
+
Home-page: https://github.com/stefankoegl/python-json-patch
|
|
6
|
+
Author: Stefan Kögl
|
|
7
|
+
Author-email: stefan@skoegl.net
|
|
8
|
+
License: Modified BSD License
|
|
9
|
+
Project-URL: Website, https://github.com/stefankoegl/python-json-patch
|
|
10
|
+
Project-URL: Repository, https://github.com/stefankoegl/python-json-patch.git
|
|
11
|
+
Project-URL: Documentation, https://python-json-patch.readthedocs.org/
|
|
12
|
+
Project-URL: PyPI, https://pypi.org/pypi/jsonpatch
|
|
13
|
+
Project-URL: Tests, https://travis-ci.org/stefankoegl/python-json-patch
|
|
14
|
+
Project-URL: Test Coverage, https://coveralls.io/r/stefankoegl/python-json-patch
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
27
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
28
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
29
|
+
Classifier: Topic :: Utilities
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
License-File: AUTHORS
|
|
34
|
+
Requires-Dist: jsonpointer>=1.9
|
|
35
|
+
Dynamic: author
|
|
36
|
+
Dynamic: author-email
|
|
37
|
+
Dynamic: classifier
|
|
38
|
+
Dynamic: description
|
|
39
|
+
Dynamic: description-content-type
|
|
40
|
+
Dynamic: home-page
|
|
41
|
+
Dynamic: license
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
Dynamic: project-url
|
|
44
|
+
Dynamic: requires-dist
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
Dynamic: summary
|
|
47
|
+
|
|
48
|
+
python-json-patch
|
|
49
|
+
=================
|
|
50
|
+
|
|
51
|
+
[](https://pypi.python.org/pypi/jsonpatch/)
|
|
52
|
+
[](https://pypi.python.org/pypi/jsonpatch/)
|
|
53
|
+
[](https://travis-ci.org/stefankoegl/python-json-patch)
|
|
54
|
+
[](https://coveralls.io/r/stefankoegl/python-json-patch?branch=master)
|
|
55
|
+
|
|
56
|
+
Applying JSON Patches in Python
|
|
57
|
+
-------------------------------
|
|
58
|
+
|
|
59
|
+
Library to apply JSON Patches according to
|
|
60
|
+
[RFC 6902](http://tools.ietf.org/html/rfc6902)
|
|
61
|
+
|
|
62
|
+
See source code for examples
|
|
63
|
+
|
|
64
|
+
* Website: https://github.com/stefankoegl/python-json-patch
|
|
65
|
+
* Repository: https://github.com/stefankoegl/python-json-patch.git
|
|
66
|
+
* Documentation: https://python-json-patch.readthedocs.org/
|
|
67
|
+
* PyPI: https://pypi.python.org/pypi/jsonpatch
|
|
68
|
+
* Travis CI: https://travis-ci.org/stefankoegl/python-json-patch
|
|
69
|
+
* Coveralls: https://coveralls.io/r/stefankoegl/python-json-patch
|
|
70
|
+
|
|
71
|
+
Running external tests
|
|
72
|
+
----------------------
|
|
73
|
+
To run external tests (such as those from https://github.com/json-patch/json-patch-tests) use ext_test.py
|
|
74
|
+
|
|
75
|
+
./ext_tests.py ../json-patch-tests/tests.json
|
|
76
|
+
|
|
77
|
+
Running property-based tests
|
|
78
|
+
----------------------------
|
|
79
|
+
Property-based tests using [Hypothesis](https://hypothesis.readthedocs.io/)
|
|
80
|
+
are in property_tests.py. Properties that the implementation does not satisfy
|
|
81
|
+
yet are marked as expected failures.
|
|
82
|
+
|
|
83
|
+
pip install hypothesis
|
|
84
|
+
python property_tests.py
|
|
85
|
+
|
|
86
|
+
Set `HYPOTHESIS_PROFILE=thorough` to run many more examples.
|