jsonpatch 1.7__py3-none-any.whl → 1.34__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.
- {jsonpatch-1.7.data → jsonpatch-1.34.data}/scripts/jsondiff +5 -5
- {jsonpatch-1.7.data → jsonpatch-1.34.data}/scripts/jsonpatch +4 -3
- jsonpatch-1.34.dist-info/METADATA +86 -0
- jsonpatch-1.34.dist-info/RECORD +9 -0
- {jsonpatch-1.7.dist-info → jsonpatch-1.34.dist-info}/WHEEL +1 -1
- jsonpatch-1.34.dist-info/licenses/AUTHORS +4 -0
- jsonpatch-1.34.dist-info/licenses/LICENSE +11 -0
- jsonpatch.py +667 -444
- jsonpatch-1.7.dist-info/DESCRIPTION.rst +0 -3
- jsonpatch-1.7.dist-info/METADATA +0 -31
- jsonpatch-1.7.dist-info/RECORD +0 -10
- jsonpatch-1.7.dist-info/entry_points.txt +0 -4
- jsonpatch-1.7.dist-info/metadata.json +0 -1
- {jsonpatch-1.7.dist-info → jsonpatch-1.34.dist-info}/top_level.txt +0 -0
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
|
-
from __future__ import print_function
|
|
5
|
-
|
|
6
4
|
import sys
|
|
7
|
-
import os.path
|
|
8
5
|
import json
|
|
9
6
|
import jsonpatch
|
|
10
7
|
import argparse
|
|
@@ -15,6 +12,8 @@ parser.add_argument('FILE1', type=argparse.FileType('r'))
|
|
|
15
12
|
parser.add_argument('FILE2', type=argparse.FileType('r'))
|
|
16
13
|
parser.add_argument('--indent', type=int, default=None,
|
|
17
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')
|
|
18
17
|
parser.add_argument('-v', '--version', action='version',
|
|
19
18
|
version='%(prog)s ' + jsonpatch.__version__)
|
|
20
19
|
|
|
@@ -32,8 +31,9 @@ def diff_files():
|
|
|
32
31
|
doc1 = json.load(args.FILE1)
|
|
33
32
|
doc2 = json.load(args.FILE2)
|
|
34
33
|
patch = jsonpatch.make_patch(doc1, doc2)
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if patch.patch:
|
|
35
|
+
print(json.dumps(patch.patch, indent=args.indent, ensure_ascii=not(args.preserve_unicode)))
|
|
36
|
+
sys.exit(1)
|
|
37
37
|
|
|
38
38
|
if __name__ == "__main__":
|
|
39
39
|
main()
|
|
@@ -24,7 +24,8 @@ parser.add_argument('-i', '--in-place', action='store_true',
|
|
|
24
24
|
help='Modify ORIGINAL in-place instead of to stdout')
|
|
25
25
|
parser.add_argument('-v', '--version', action='version',
|
|
26
26
|
version='%(prog)s ' + jsonpatch.__version__)
|
|
27
|
-
|
|
27
|
+
parser.add_argument('-u', '--preserve-unicode', action='store_true',
|
|
28
|
+
help='Output Unicode character as-is without using Code Point')
|
|
28
29
|
|
|
29
30
|
def main():
|
|
30
31
|
try:
|
|
@@ -72,8 +73,8 @@ def patch_files():
|
|
|
72
73
|
|
|
73
74
|
# By this point we have some sort of file object we can write the
|
|
74
75
|
# modified JSON to.
|
|
75
|
-
|
|
76
|
-
json.dump(result, fp, indent=args.indent)
|
|
76
|
+
|
|
77
|
+
json.dump(result, fp, indent=args.indent, ensure_ascii=not(args.preserve_unicode))
|
|
77
78
|
fp.write('\n')
|
|
78
79
|
|
|
79
80
|
if args.in_place:
|
|
@@ -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.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
jsonpatch.py,sha256=fwTHkealtmPMEfKAEW0uHpyWixn4XnQOOL8mmkH4E0g,32582
|
|
2
|
+
jsonpatch-1.34.data/scripts/jsondiff,sha256=pJy1A-g4ON2Nf7SVfjE597OaBbMe4Yp_UZNWBUnrlPQ,1148
|
|
3
|
+
jsonpatch-1.34.data/scripts/jsonpatch,sha256=qTdum0oHcrMmJE1Da-h-sfUHQEYQBp1XQ-QD0D16dHg,3848
|
|
4
|
+
jsonpatch-1.34.dist-info/licenses/AUTHORS,sha256=hOtEnBGbfDegKjzMDEl5vuVJyczbI2PlYE2ho4LjGNQ,140
|
|
5
|
+
jsonpatch-1.34.dist-info/licenses/LICENSE,sha256=Q5PrZzP6HjZ_QXabOC9PG-e_Da6x4kPtkrP12Lr9I28,1481
|
|
6
|
+
jsonpatch-1.34.dist-info/METADATA,sha256=u0wy9hYBgDw9MMpQNUFn2cxr6ZbRYcFhbE1PiOjVdNo,3523
|
|
7
|
+
jsonpatch-1.34.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
8
|
+
jsonpatch-1.34.dist-info/top_level.txt,sha256=zcviI7Mh4AvvPBpgKZBzEdgbVh_ewsfvS2t3-wcsnN4,10
|
|
9
|
+
jsonpatch-1.34.dist-info/RECORD,,
|
|
@@ -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.
|