jsonyx 2.3.0__tar.gz → 2.5.0__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.
Files changed (37) hide show
  1. jsonyx-2.5.0/LICENSE +165 -0
  2. {jsonyx-2.3.0 → jsonyx-2.5.0}/PKG-INFO +99 -118
  3. jsonyx-2.5.0/README.md +54 -0
  4. {jsonyx-2.3.0 → jsonyx-2.5.0}/setup.cfg +4 -4
  5. {jsonyx-2.3.0 → jsonyx-2.5.0}/setup.py +65 -54
  6. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/__init__.py +191 -92
  7. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/__main__.py +260 -274
  8. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/_decoder.py +141 -108
  9. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/_differ.py +148 -146
  10. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/_encoder.py +148 -96
  11. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/_manipulator.py +703 -753
  12. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/_speedups.c +2559 -2265
  13. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/allow.py +139 -114
  14. jsonyx-2.5.0/src/jsonyx/py.typed +2 -0
  15. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/__init__.py +27 -27
  16. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/conftest.py +57 -46
  17. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_apply_filter.py +141 -138
  18. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_apply_patch.py +271 -276
  19. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_dump.py +25 -25
  20. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_dumps.py +764 -682
  21. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_jsonyx.py +108 -101
  22. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_load_query_value.py +151 -177
  23. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_loads.py +667 -692
  24. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_make_patch.py +107 -106
  25. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_paste_values.py +83 -83
  26. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_select_nodes.py +316 -346
  27. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_syntax_error.py +216 -215
  28. jsonyx-2.5.0/src/jsonyx/test/test_threading.py +114 -0
  29. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx/test/test_write.py +50 -40
  30. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx.egg-info/PKG-INFO +99 -118
  31. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx.egg-info/SOURCES.txt +2 -0
  32. jsonyx-2.3.0/LICENSE +0 -674
  33. jsonyx-2.3.0/README.md +0 -75
  34. jsonyx-2.3.0/src/jsonyx/py.typed +0 -2
  35. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx.egg-info/dependency_links.txt +0 -0
  36. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx.egg-info/entry_points.txt +0 -0
  37. {jsonyx-2.3.0 → jsonyx-2.5.0}/src/jsonyx.egg-info/top_level.txt +0 -0
jsonyx-2.5.0/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -1,118 +1,99 @@
1
- Metadata-Version: 2.4
2
- Name: jsonyx
3
- Version: 2.3.0
4
- Summary: Customizable JSON library for Python
5
- Author: Nice Zombies
6
- Author-email: nineteendo19d0@gmail.com
7
- Maintainer: Nice Zombies
8
- Maintainer-email: nineteendo19d0@gmail.com
9
- License: GPL-3.0
10
- Project-URL: Homepage, https://github.com/nineteendo/jsonyx
11
- Project-URL: Changelog, https://jsonyx.readthedocs.io/en/latest/changelog.html
12
- Project-URL: Documentation, https://jsonyx.readthedocs.io
13
- Project-URL: Issues, https://github.com/nineteendo/jsonyx/issues
14
- Project-URL: Sponser, https://paypal.me/nineteendo
15
- Keywords: python,json,json-parser
16
- Classifier: Development Status :: 5 - Production/Stable
17
- Classifier: Intended Audience :: Developers
18
- Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
22
- Classifier: Programming Language :: Python :: 3.10
23
- Classifier: Programming Language :: Python :: 3.11
24
- Classifier: Programming Language :: Python :: 3.12
25
- Classifier: Programming Language :: Python :: 3.13
26
- Classifier: Programming Language :: Python :: 3.14
27
- Requires-Python: >=3.8
28
- Description-Content-Type: text/markdown
29
- License-File: LICENSE
30
- Dynamic: author
31
- Dynamic: author-email
32
- Dynamic: classifier
33
- Dynamic: description
34
- Dynamic: description-content-type
35
- Dynamic: keywords
36
- Dynamic: license
37
- Dynamic: license-file
38
- Dynamic: maintainer
39
- Dynamic: maintainer-email
40
- Dynamic: project-url
41
- Dynamic: requires-python
42
- Dynamic: summary
43
-
44
- # jsonyx
45
-
46
- [![pypi](https://img.shields.io/pypi/v/jsonyx.svg)](http://pypi.org/project/jsonyx)
47
- [![conda-forge](https://img.shields.io/conda/vn/conda-forge/jsonyx.svg)](https://anaconda.org/conda-forge/jsonyx)
48
- [![python](https://img.shields.io/pypi/pyversions/jsonyx.svg)](http://pypi.org/project/jsonyx)
49
- [![license](https://img.shields.io/pypi/l/jsonyx.svg)](http://pypi.org/project/jsonyx)
50
- [![pytest](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml/badge.svg?branch=2.3.x)](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml)
51
- [![docs](https://readthedocs.org/projects/jsonyx/badge/?version=stable)](https://jsonyx.readthedocs.io/en/stable/?badge=stable)
52
- [![downloads](https://img.shields.io/pypi/dm/jsonyx.svg)](http://pypi.org/project/jsonyx)
53
-
54
- `jsonyx` is a customizable [JSON](http://json.org) library for Python 3.8+. It
55
- is written in pure Python with an optional C extension for better performance
56
- and no dependencies.
57
-
58
- The documentation for `jsonyx` is available online at: https://jsonyx.readthedocs.io
59
-
60
- ## Key Features
61
-
62
- - JSON decoding, encoding and patching
63
- - Pretty printing:
64
- ```json
65
- {
66
- "foo": [1, 2, 3],
67
- "bar": {"a": 1, "b": 2, "c": 3}
68
- }
69
- ```
70
- - Optionally supports these JSON deviations (specified in the documentation):
71
- ```javascript
72
- {
73
- /* Block */ // and line comments
74
- "Missing commas": [1 2 3],
75
- "NaN and infinity": [NaN, Infinity, -Infinity],
76
- "Surrogates": "\ud800",
77
- "Trailing comma": [0,],
78
- "Unquoted keys": {key: "value"}
79
- }
80
- ```
81
- - Detailed error messages:
82
- ```none
83
- Traceback (most recent call last):
84
- File "/Users/wannes/Downloads/broken.json", line 1, column 99-381
85
- ...sList": {"GlossEntry": {"ID": "SGM..."GML", "XML"]}, "GlossSee": "markup"
86
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
- jsonyx.JSONSyntaxError: Unterminated object
88
- ```
89
- - Dedicated functions for reading and writing files and pretty printing
90
-
91
- ## Benchmark (Apr 30, 2025)
92
-
93
- We recommend to use [`orjson`](https://pypi.org/project/orjson),
94
- [`msgspec`](https://pypi.org/project/msgspec) or
95
- [`pysimdjson`](https://pypi.org/project/pysimdjson) for performance critical
96
- applications:
97
-
98
- | encode | json | jsonyx | msgspec | orjson | fastest time |
99
- |:--------------------------------------------|-------:|-------:|--------:|-------:|-------------:|
100
- | List of 256 booleans | 4.62x | 4.17x | 1.06x | 1.00x | 1.82 μs |
101
- | List of 256 ASCII strings | 14.09x | 8.10x | 1.66x | 1.00x | 3.66 μs |
102
- | List of 256 floats | 25.20x | 25.18x | 1.33x | 1.00x | 8.07 μs |
103
- | List of 256 dicts with 1 int | 11.24x | 9.89x | 1.34x | 1.00x | 7.87 μs |
104
- | Medium complex object | 10.21x | 8.85x | 1.17x | 1.00x | 13.87 μs |
105
- | List of 256 strings | 26.46x | 15.18x | 2.23x | 1.00x | 13.37 μs |
106
- | Complex object | 7.86x | 7.41x | 1.00x | DNF | 207.83 μs |
107
- | Dict with 256 lists of 256 dicts with 1 int | 9.87x | 8.72x | 1.24x | 1.00x | 2295.24 μs |
108
-
109
- | decode | json | jsonyx | msgspec | orjson | simdjson | fastest time |
110
- |:--------------------------------------------|-------:|--------:|--------:|-------:|---------:|-------------:|
111
- | List of 256 booleans | 4.70x | 5.22x | 2.92x | 1.41x | 1.00x | 1.45 μs |
112
- | List of 256 ASCII strings | 9.04x | 7.05x | 4.85x | 4.43x | 1.00x | 3.15 μs |
113
- | List of 256 floats | 10.91x | 11.22x | 2.24x | 1.73x | 1.00x | 6.14 μs |
114
- | List of 256 dicts with 1 int | 12.99x | 11.65x | 7.35x | 5.30x | 1.00x | 6.11 μs |
115
- | Medium complex object | 13.41x | 12.94x | 5.44x | 4.67x | 1.00x | 7.65 μs |
116
- | List of 256 strings | 6.85x | 3.75x | 9.56x | 7.85x | 1.00x | 16.78 μs |
117
- | Complex object | 9.36x | 7.63x | 8.55x | 7.67x | 1.00x | 136.11 μs |
118
- | Dict with 256 lists of 256 dicts with 1 int | 19.03x | 15.62x | 11.58x | 9.87x | 1.00x | 1640.77 μs |
1
+ Metadata-Version: 2.4
2
+ Name: jsonyx
3
+ Version: 2.5.0
4
+ Summary: Customizable JSON library for Python
5
+ Author: Nice Zombies
6
+ Author-email: nineteendo19d0@gmail.com
7
+ Maintainer: Nice Zombies
8
+ Maintainer-email: nineteendo19d0@gmail.com
9
+ License: LGPL-3.0
10
+ Project-URL: Homepage, https://github.com/nineteendo/jsonyx
11
+ Project-URL: Changelog, https://jsonyx.readthedocs.io/en/latest/changelog.html
12
+ Project-URL: Documentation, https://jsonyx.readthedocs.io
13
+ Project-URL: Issues, https://github.com/nineteendo/jsonyx/issues
14
+ Project-URL: Sponser, https://paypal.me/nineteendo
15
+ Keywords: python,json,json-parser
16
+ Classifier: Development Status :: 5 - Production/Stable
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Programming Language :: Python :: 3.15
28
+ Classifier: Programming Language :: Python :: Free Threading
29
+ Requires-Python: >=3.8
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Dynamic: author
33
+ Dynamic: author-email
34
+ Dynamic: classifier
35
+ Dynamic: description
36
+ Dynamic: description-content-type
37
+ Dynamic: keywords
38
+ Dynamic: license
39
+ Dynamic: license-file
40
+ Dynamic: maintainer
41
+ Dynamic: maintainer-email
42
+ Dynamic: project-url
43
+ Dynamic: requires-python
44
+ Dynamic: summary
45
+
46
+ # jsonyx
47
+
48
+ [![pypi](https://img.shields.io/pypi/v/jsonyx.svg)](http://pypi.org/project/jsonyx)
49
+ [![conda-forge](https://img.shields.io/conda/vn/conda-forge/jsonyx.svg)](https://anaconda.org/conda-forge/jsonyx)
50
+ [![python](https://img.shields.io/pypi/pyversions/jsonyx.svg)](http://pypi.org/project/jsonyx)
51
+ [![license](https://img.shields.io/pypi/l/jsonyx.svg)](http://pypi.org/project/jsonyx)
52
+ [![pytest](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml/badge.svg?branch=2.5.x)](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml)
53
+ [![docs](https://readthedocs.org/projects/jsonyx/badge/?version=stable)](https://jsonyx.readthedocs.io/en/stable/?badge=stable)
54
+ [![downloads](https://img.shields.io/pypi/dm/jsonyx.svg)](http://pypi.org/project/jsonyx)
55
+
56
+ `jsonyx` is a customizable [JSON](http://json.org) library for Python 3.8+. It
57
+ is written in pure Python with an optional C extension for better performance
58
+ and no dependencies.
59
+
60
+ ## Key Features
61
+
62
+ - JSON encoding, decoding and patching:
63
+ ```python
64
+ >>> import jsonyx as json
65
+ >>> json.dumps(["foo", {"bar": ("baz", None, 1.0, 2)}])
66
+ '["foo", {"bar": ["baz", null, 1.0, 2]}]\n'
67
+ >>> json.loads('{"foo": ["bar", null, 1.0, 2]}')
68
+ {'foo': ['bar', None, 1.0, 2]}
69
+ >>> json.apply_patch([1, 2, 3], {"op": "del", "path": "$[1]"})
70
+ [1, 3]
71
+ ```
72
+ - Compact formatting of arrays and objects:
73
+ ```json
74
+ {
75
+ "foo": [1, 2, 3],
76
+ "bar": {"a": 1, "b": 2, "c": 3}
77
+ }
78
+ ```
79
+ - Optionally supports these JSON deviations (specified in the documentation):
80
+ ```javascript
81
+ {
82
+ /* Block */ // and line comments
83
+ "Missing commas": [1 2 3],
84
+ "NaN and infinity": [NaN, Infinity, -Infinity],
85
+ "Surrogates": "\ud800",
86
+ "Trailing comma": [0,],
87
+ "Unquoted keys": {key: "value"}
88
+ }
89
+ ```
90
+ - Detailed error messages:
91
+ ```none
92
+ Traceback (most recent call last):
93
+ File "/Users/wannes/Downloads/broken.json", line 1, column 99-381
94
+ ...sList": {"GlossEntry": {"ID": "SGM..."GML", "XML"]}, "GlossSee": "markup"
95
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
+ jsonyx.JSONSyntaxError: Unterminated object
97
+ ```
98
+
99
+ The documentation for `jsonyx` is available online at: https://jsonyx.readthedocs.io
jsonyx-2.5.0/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # jsonyx
2
+
3
+ [![pypi](https://img.shields.io/pypi/v/jsonyx.svg)](http://pypi.org/project/jsonyx)
4
+ [![conda-forge](https://img.shields.io/conda/vn/conda-forge/jsonyx.svg)](https://anaconda.org/conda-forge/jsonyx)
5
+ [![python](https://img.shields.io/pypi/pyversions/jsonyx.svg)](http://pypi.org/project/jsonyx)
6
+ [![license](https://img.shields.io/pypi/l/jsonyx.svg)](http://pypi.org/project/jsonyx)
7
+ [![pytest](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml/badge.svg?branch=2.5.x)](https://github.com/nineteendo/jsonyx/actions/workflows/pytest.yml)
8
+ [![docs](https://readthedocs.org/projects/jsonyx/badge/?version=stable)](https://jsonyx.readthedocs.io/en/stable/?badge=stable)
9
+ [![downloads](https://img.shields.io/pypi/dm/jsonyx.svg)](http://pypi.org/project/jsonyx)
10
+
11
+ `jsonyx` is a customizable [JSON](http://json.org) library for Python 3.8+. It
12
+ is written in pure Python with an optional C extension for better performance
13
+ and no dependencies.
14
+
15
+ ## Key Features
16
+
17
+ - JSON encoding, decoding and patching:
18
+ ```python
19
+ >>> import jsonyx as json
20
+ >>> json.dumps(["foo", {"bar": ("baz", None, 1.0, 2)}])
21
+ '["foo", {"bar": ["baz", null, 1.0, 2]}]\n'
22
+ >>> json.loads('{"foo": ["bar", null, 1.0, 2]}')
23
+ {'foo': ['bar', None, 1.0, 2]}
24
+ >>> json.apply_patch([1, 2, 3], {"op": "del", "path": "$[1]"})
25
+ [1, 3]
26
+ ```
27
+ - Compact formatting of arrays and objects:
28
+ ```json
29
+ {
30
+ "foo": [1, 2, 3],
31
+ "bar": {"a": 1, "b": 2, "c": 3}
32
+ }
33
+ ```
34
+ - Optionally supports these JSON deviations (specified in the documentation):
35
+ ```javascript
36
+ {
37
+ /* Block */ // and line comments
38
+ "Missing commas": [1 2 3],
39
+ "NaN and infinity": [NaN, Infinity, -Infinity],
40
+ "Surrogates": "\ud800",
41
+ "Trailing comma": [0,],
42
+ "Unquoted keys": {key: "value"}
43
+ }
44
+ ```
45
+ - Detailed error messages:
46
+ ```none
47
+ Traceback (most recent call last):
48
+ File "/Users/wannes/Downloads/broken.json", line 1, column 99-381
49
+ ...sList": {"GlossEntry": {"ID": "SGM..."GML", "XML"]}, "GlossSee": "markup"
50
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51
+ jsonyx.JSONSyntaxError: Unterminated object
52
+ ```
53
+
54
+ The documentation for `jsonyx` is available online at: https://jsonyx.readthedocs.io
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,54 +1,65 @@
1
- """jsonyx setup."""
2
- from __future__ import annotations
3
-
4
- __all__: list[str] = []
5
-
6
- from pathlib import Path
7
-
8
- # pylint: disable-next=E0401
9
- from setuptools import Extension, setup # type: ignore
10
-
11
- if __name__ == "__main__":
12
- setup(
13
- name="jsonyx",
14
- version="2.3.0",
15
- description="Customizable JSON library for Python",
16
- long_description=Path("README.md").read_text(encoding="utf-8"),
17
- long_description_content_type="text/markdown",
18
- author="Nice Zombies",
19
- author_email="nineteendo19d0@gmail.com",
20
- maintainer="Nice Zombies",
21
- maintainer_email="nineteendo19d0@gmail.com",
22
- packages=["jsonyx", "jsonyx.test"],
23
- ext_modules=[
24
- Extension("_jsonyx", ["src/jsonyx/_speedups.c"], optional=True),
25
- ],
26
- classifiers=[
27
- "Development Status :: 5 - Production/Stable",
28
- "Intended Audience :: Developers",
29
- "Operating System :: OS Independent",
30
- "Programming Language :: Python :: 3 :: Only",
31
- "Programming Language :: Python :: 3.8",
32
- "Programming Language :: Python :: 3.9",
33
- "Programming Language :: Python :: 3.10",
34
- "Programming Language :: Python :: 3.11",
35
- "Programming Language :: Python :: 3.12",
36
- "Programming Language :: Python :: 3.13",
37
- "Programming Language :: Python :: 3.14",
38
- ],
39
- license="GPL-3.0",
40
- keywords=["python", "json", "json-parser"],
41
- package_dir={"": "src"},
42
- # setuptools arguments
43
- entry_points={"console_scripts": ["jsonyx = jsonyx.__main__:main"]},
44
- python_requires=">=3.8",
45
- project_urls={
46
- "Homepage": "https://github.com/nineteendo/jsonyx",
47
- "Changelog": (
48
- "https://jsonyx.readthedocs.io/en/latest/changelog.html"
49
- ),
50
- "Documentation": "https://jsonyx.readthedocs.io",
51
- "Issues": "https://github.com/nineteendo/jsonyx/issues",
52
- "Sponser": "https://paypal.me/nineteendo",
53
- },
54
- )
1
+ """jsonyx setup."""
2
+ from __future__ import annotations
3
+
4
+ __all__: list[str] = []
5
+
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ # pylint: disable-next=E0401
10
+ from setuptools import Extension, setup # type: ignore
11
+
12
+ if sys.platform != "win32":
13
+ _EXTRA_COMPILE_ARGS: list[str] | None = None
14
+ else:
15
+ _EXTRA_COMPILE_ARGS = ["/std:c11", "/experimental:c11atomics"]
16
+
17
+ if __name__ == "__main__":
18
+ setup(
19
+ name="jsonyx",
20
+ version="2.5.0",
21
+ description="Customizable JSON library for Python",
22
+ long_description=Path("README.md").read_text(encoding="utf-8"),
23
+ long_description_content_type="text/markdown",
24
+ author="Nice Zombies",
25
+ author_email="nineteendo19d0@gmail.com",
26
+ maintainer="Nice Zombies",
27
+ maintainer_email="nineteendo19d0@gmail.com",
28
+ packages=["jsonyx", "jsonyx.test"],
29
+ ext_modules=[Extension(
30
+ "_jsonyx",
31
+ ["src/jsonyx/_speedups.c"],
32
+ extra_compile_args=_EXTRA_COMPILE_ARGS,
33
+ optional=True,
34
+ )],
35
+ classifiers=[
36
+ "Development Status :: 5 - Production/Stable",
37
+ "Intended Audience :: Developers",
38
+ "Operating System :: OS Independent",
39
+ "Programming Language :: Python :: 3 :: Only",
40
+ "Programming Language :: Python :: 3.8",
41
+ "Programming Language :: Python :: 3.9",
42
+ "Programming Language :: Python :: 3.10",
43
+ "Programming Language :: Python :: 3.11",
44
+ "Programming Language :: Python :: 3.12",
45
+ "Programming Language :: Python :: 3.13",
46
+ "Programming Language :: Python :: 3.14",
47
+ "Programming Language :: Python :: 3.15",
48
+ "Programming Language :: Python :: Free Threading",
49
+ ],
50
+ license="LGPL-3.0",
51
+ keywords=["python", "json", "json-parser"],
52
+ package_dir={"": "src"},
53
+ # setuptools arguments
54
+ entry_points={"console_scripts": ["jsonyx = jsonyx.__main__:main"]},
55
+ python_requires=">=3.8",
56
+ project_urls={
57
+ "Homepage": "https://github.com/nineteendo/jsonyx",
58
+ "Changelog": (
59
+ "https://jsonyx.readthedocs.io/en/latest/changelog.html"
60
+ ),
61
+ "Documentation": "https://jsonyx.readthedocs.io",
62
+ "Issues": "https://github.com/nineteendo/jsonyx/issues",
63
+ "Sponser": "https://paypal.me/nineteendo",
64
+ },
65
+ )