python-rapidjson 1.20__tar.gz → 1.22__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 (95) hide show
  1. {python_rapidjson-1.20 → python_rapidjson-1.22}/CHANGES.rst +28 -1
  2. {python_rapidjson-1.20 → python_rapidjson-1.22}/PKG-INFO +68 -8
  3. {python_rapidjson-1.20 → python_rapidjson-1.22}/README.rst +22 -2
  4. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/benchmarks-tables.rst +43 -43
  5. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/changes.rst +28 -1
  6. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/quickstart.rst +20 -1
  7. {python_rapidjson-1.20 → python_rapidjson-1.22}/python_rapidjson.egg-info/PKG-INFO +68 -8
  8. {python_rapidjson-1.20 → python_rapidjson-1.22}/python_rapidjson.egg-info/SOURCES.txt +1 -1
  9. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/document.h +2 -1
  10. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/encodings.h +2 -2
  11. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/strtod.h +1 -1
  12. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/pointer.h +7 -1
  13. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/reader.h +2 -2
  14. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/schema.h +2 -3
  15. python_rapidjson-1.22/rapidjson_exact_version.txt +1 -0
  16. {python_rapidjson-1.20 → python_rapidjson-1.22}/requirements-test.txt +5 -5
  17. {python_rapidjson-1.20 → python_rapidjson-1.22}/requirements.txt +8 -8
  18. {python_rapidjson-1.20 → python_rapidjson-1.22}/setup.py +6 -6
  19. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_memory_leaks.py +7 -4
  20. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_refs_count.py +5 -4
  21. {python_rapidjson-1.20 → python_rapidjson-1.22}/typings/rapidjson/__init__.pyi +1 -1
  22. python_rapidjson-1.20/rapidjson_exact_version.txt +0 -1
  23. python_rapidjson-1.20/version.txt +0 -1
  24. {python_rapidjson-1.20 → python_rapidjson-1.22}/.dir-locals.el +0 -0
  25. {python_rapidjson-1.20 → python_rapidjson-1.22}/LICENSE +0 -0
  26. {python_rapidjson-1.20 → python_rapidjson-1.22}/MANIFEST.in +0 -0
  27. {python_rapidjson-1.20 → python_rapidjson-1.22}/benchmarks/conftest.py +0 -0
  28. {python_rapidjson-1.20 → python_rapidjson-1.22}/benchmarks/tablize.py +0 -0
  29. {python_rapidjson-1.20 → python_rapidjson-1.22}/benchmarks/test_benchmark.py +0 -0
  30. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/Makefile +0 -0
  31. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/api.rst +0 -0
  32. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/benchmarks.rst +0 -0
  33. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/conf.py +0 -0
  34. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/decoder.rst +0 -0
  35. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/dump.rst +0 -0
  36. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/dumps.rst +0 -0
  37. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/encoder.rst +0 -0
  38. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/index.rst +0 -0
  39. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/load.rst +0 -0
  40. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/loads.rst +0 -0
  41. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/rawjson.rst +0 -0
  42. {python_rapidjson-1.20 → python_rapidjson-1.22}/docs/validator.rst +0 -0
  43. {python_rapidjson-1.20 → python_rapidjson-1.22}/python_rapidjson.egg-info/dependency_links.txt +0 -0
  44. {python_rapidjson-1.20 → python_rapidjson-1.22}/python_rapidjson.egg-info/top_level.txt +0 -0
  45. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/allocators.h +0 -0
  46. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -0
  47. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/encodedstream.h +0 -0
  48. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/error/en.h +0 -0
  49. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/error/error.h +0 -0
  50. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/filereadstream.h +0 -0
  51. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/filewritestream.h +0 -0
  52. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/fwd.h +0 -0
  53. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/biginteger.h +0 -0
  54. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/clzll.h +0 -0
  55. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/diyfp.h +0 -0
  56. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/dtoa.h +0 -0
  57. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/ieee754.h +0 -0
  58. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/itoa.h +0 -0
  59. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/meta.h +0 -0
  60. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/pow10.h +0 -0
  61. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/regex.h +0 -0
  62. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/stack.h +0 -0
  63. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/strfunc.h +0 -0
  64. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/internal/swap.h +0 -0
  65. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/istreamwrapper.h +0 -0
  66. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/memorybuffer.h +0 -0
  67. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/memorystream.h +0 -0
  68. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -0
  69. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -0
  70. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/ostreamwrapper.h +0 -0
  71. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/prettywriter.h +0 -0
  72. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/rapidjson.h +0 -0
  73. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/stream.h +0 -0
  74. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/stringbuffer.h +0 -0
  75. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/uri.h +0 -0
  76. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/include/rapidjson/writer.h +0 -0
  77. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/license.txt +0 -0
  78. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson/readme.md +0 -0
  79. {python_rapidjson-1.20 → python_rapidjson-1.22}/rapidjson.cpp +0 -0
  80. {python_rapidjson-1.20 → python_rapidjson-1.22}/setup.cfg +0 -0
  81. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/conftest.py +0 -0
  82. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_base_types.py +0 -0
  83. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_circular.py +0 -0
  84. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_dict_subclass.py +0 -0
  85. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_enum.py +0 -0
  86. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_float.py +0 -0
  87. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_params.py +0 -0
  88. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_pass1.py +0 -0
  89. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_pass2.py +0 -0
  90. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_pass3.py +0 -0
  91. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_rawjson.py +0 -0
  92. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_streams.py +0 -0
  93. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_unicode.py +0 -0
  94. {python_rapidjson-1.20 → python_rapidjson-1.22}/tests/test_validator.py +0 -0
  95. {python_rapidjson-1.20 → python_rapidjson-1.22}/tox.ini +0 -0
@@ -1,10 +1,37 @@
1
1
  Changes
2
2
  -------
3
3
 
4
+ 1.22 (2025-10-21)
5
+ ~~~~~~~~~~~~~~~~~
6
+
7
+ * Generate wheels on PyPI using Python 3.14 final release, thanks to cibuildwheel `3.2.1`__
8
+
9
+ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v321
10
+
11
+
12
+ 1.21 (2025-07-10)
13
+ ~~~~~~~~~~~~~~~~~
14
+
15
+ * Use `current master`__ version of rapidjson, thanks to Kyle Gottfried (although I didn't
16
+ merge his `PR #224`__)
17
+
18
+ __ https://github.com/Tencent/rapidjson/compare/ab1842a2dae061284c0a62dca1cc6d5e7e37e346..24b5e7a8b27f42fa16b96fc70aade9106cf7102f
19
+ __ https://github.com/python-rapidjson/python-rapidjson/pull/224
20
+
21
+ * Recompute comparison table with latest versions of other libraries, using Python 3.13
22
+
23
+ * Typing stubs: specify default value for ``stream`` argument of ``Encoder.__call__()``
24
+ (`issue #215`__)
25
+
26
+ __ https://github.com/python-rapidjson/python-rapidjson/issues/215
27
+
28
+ * Use more recent OS images on GH Actions to test and build wheels
29
+
30
+
4
31
  1.20 (2024-08-05)
5
32
  ~~~~~~~~~~~~~~~~~
6
33
 
7
- * Rectify type hints if ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
34
+ * Rectify type hints of ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
8
35
 
9
36
  __ https://github.com/python-rapidjson/python-rapidjson/issues/214
10
37
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-rapidjson
3
- Version: 1.20
3
+ Version: 1.22
4
4
  Summary: Python wrapper around rapidjson
5
5
  Home-page: https://github.com/python-rapidjson/python-rapidjson
6
6
  Author: Ken Robbins
@@ -8,29 +8,42 @@ Author-email: ken@kenrobbins.com
8
8
  Maintainer: Lele Gaifax
9
9
  Maintainer-email: lele@metapensiero.it
10
10
  License: MIT License
11
- Keywords: json rapidjson
11
+ Keywords: json jsonc rapidjson
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Programming Language :: C++
16
15
  Classifier: Programming Language :: Python :: 3 :: Only
17
16
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
20
18
  Classifier: Programming Language :: Python :: 3.10
21
19
  Classifier: Programming Language :: Python :: 3.11
22
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
23
  Classifier: Programming Language :: Python
24
24
  Requires-Python: >=3.6
25
25
  Description-Content-Type: text/x-rst
26
26
  License-File: LICENSE
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+ Dynamic: maintainer
37
+ Dynamic: maintainer-email
38
+ Dynamic: requires-python
39
+ Dynamic: summary
27
40
 
28
41
  .. -*- coding: utf-8 -*-
29
42
  .. :Project: python-rapidjson -- Introduction
30
43
  .. :Author: Ken Robbins <ken@kenrobbins.com>
31
44
  .. :License: MIT License
32
45
  .. :Copyright: © 2015 Ken Robbins
33
- .. :Copyright: © 2016, 2017, 2018, 2020, 2022 Lele Gaifax
46
+ .. :Copyright: © 2016, 2017, 2018, 2020, 2022, 2024, 2025 Lele Gaifax
34
47
  ..
35
48
 
36
49
  ==================
@@ -102,6 +115,26 @@ Basic usage looks like this:
102
115
  Chunk: b'":"ba'
103
116
  Chunk: b'z"}'
104
117
 
118
+ Most functionalities are exposed both as *functions* and as *classes*.
119
+
120
+ The following uses a *relaxed syntax* ``Decoder`` instance, that handles JSONC__ and
121
+ *trailing commas*:
122
+
123
+ __ https://jsonc.org/
124
+
125
+ .. code-block:: python
126
+
127
+ >>> from rapidjson import Decoder
128
+ >>> from rapidjson import PM_COMMENTS, PM_TRAILING_COMMAS
129
+ >>> decoder = Decoder(parse_mode=PM_COMMENTS | PM_TRAILING_COMMAS)
130
+ >>> decoder('''
131
+ ... {
132
+ ... "bar": /* Block comment */ "baz",
133
+ ... "foo":100, // Trailing comma and comment
134
+ ... }
135
+ ... ''')
136
+ {'bar': 'baz', 'foo': 100}
137
+
105
138
 
106
139
  Development
107
140
  -----------
@@ -135,7 +168,7 @@ Performance
135
168
  ``python-rapidjson`` tries to be as performant as possible while staying
136
169
  compatible with the ``json`` module.
137
170
 
138
- See the `this section`__ in the documentation for a comparison with other JSON libraries.
171
+ See `this section`__ in the documentation for a comparison with other JSON libraries.
139
172
 
140
173
  __ https://python-rapidjson.readthedocs.io/en/latest/benchmarks.html
141
174
 
@@ -155,10 +188,37 @@ __ https://python-rapidjson.readthedocs.io/en/latest/quickstart.html#incompatibi
155
188
  Changes
156
189
  -------
157
190
 
191
+ 1.22 (2025-10-21)
192
+ ~~~~~~~~~~~~~~~~~
193
+
194
+ * Generate wheels on PyPI using Python 3.14 final release, thanks to cibuildwheel `3.2.1`__
195
+
196
+ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v321
197
+
198
+
199
+ 1.21 (2025-07-10)
200
+ ~~~~~~~~~~~~~~~~~
201
+
202
+ * Use `current master`__ version of rapidjson, thanks to Kyle Gottfried (although I didn't
203
+ merge his `PR #224`__)
204
+
205
+ __ https://github.com/Tencent/rapidjson/compare/ab1842a2dae061284c0a62dca1cc6d5e7e37e346..24b5e7a8b27f42fa16b96fc70aade9106cf7102f
206
+ __ https://github.com/python-rapidjson/python-rapidjson/pull/224
207
+
208
+ * Recompute comparison table with latest versions of other libraries, using Python 3.13
209
+
210
+ * Typing stubs: specify default value for ``stream`` argument of ``Encoder.__call__()``
211
+ (`issue #215`__)
212
+
213
+ __ https://github.com/python-rapidjson/python-rapidjson/issues/215
214
+
215
+ * Use more recent OS images on GH Actions to test and build wheels
216
+
217
+
158
218
  1.20 (2024-08-05)
159
219
  ~~~~~~~~~~~~~~~~~
160
220
 
161
- * Rectify type hints if ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
221
+ * Rectify type hints of ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
162
222
 
163
223
  __ https://github.com/python-rapidjson/python-rapidjson/issues/214
164
224
 
@@ -3,7 +3,7 @@
3
3
  .. :Author: Ken Robbins <ken@kenrobbins.com>
4
4
  .. :License: MIT License
5
5
  .. :Copyright: © 2015 Ken Robbins
6
- .. :Copyright: © 2016, 2017, 2018, 2020, 2022 Lele Gaifax
6
+ .. :Copyright: © 2016, 2017, 2018, 2020, 2022, 2024, 2025 Lele Gaifax
7
7
  ..
8
8
 
9
9
  ==================
@@ -75,6 +75,26 @@ Basic usage looks like this:
75
75
  Chunk: b'":"ba'
76
76
  Chunk: b'z"}'
77
77
 
78
+ Most functionalities are exposed both as *functions* and as *classes*.
79
+
80
+ The following uses a *relaxed syntax* ``Decoder`` instance, that handles JSONC__ and
81
+ *trailing commas*:
82
+
83
+ __ https://jsonc.org/
84
+
85
+ .. code-block:: python
86
+
87
+ >>> from rapidjson import Decoder
88
+ >>> from rapidjson import PM_COMMENTS, PM_TRAILING_COMMAS
89
+ >>> decoder = Decoder(parse_mode=PM_COMMENTS | PM_TRAILING_COMMAS)
90
+ >>> decoder('''
91
+ ... {
92
+ ... "bar": /* Block comment */ "baz",
93
+ ... "foo":100, // Trailing comma and comment
94
+ ... }
95
+ ... ''')
96
+ {'bar': 'baz', 'foo': 100}
97
+
78
98
 
79
99
  Development
80
100
  -----------
@@ -108,7 +128,7 @@ Performance
108
128
  ``python-rapidjson`` tries to be as performant as possible while staying
109
129
  compatible with the ``json`` module.
110
130
 
111
- See the `this section`__ in the documentation for a comparison with other JSON libraries.
131
+ See `this section`__ in the documentation for a comparison with other JSON libraries.
112
132
 
113
133
  __ https://python-rapidjson.readthedocs.io/en/latest/benchmarks.html
114
134
 
@@ -5,41 +5,41 @@ Serialization
5
5
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
6
6
  | serialize | ``dumps()``\ [1]_ | ``Encoder()``\ [2]_ | ``dumps(n)``\ [3]_ | ``Encoder(n)``\ [4]_ | ``PyEncoder()``\ [5]_ | simdjson\ [6]_ | orjson\ [7]_ | ujson\ [8]_ | simplejson\ [9]_ | stdlib\ [10]_ |
7
7
  +=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+
8
- | 100 arrays dict | 1.00 | 1.00 | 0.73 | 0.73 | 0.99 | 2.21 | **0.17** | 0.85 | 5.93 | 2.31 |
8
+ | 100 arrays dict | 1.00 | 1.00 | 0.73 | 0.72 | 1.00 | 1.34 | **0.14** | 0.94 | 5.48 | 1.34 |
9
9
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
10
- | 100 dicts array | 1.00 | 0.99 | 0.77 | 0.74 | 1.01 | 2.27 | **0.22** | 0.84 | 6.82 | 2.27 |
10
+ | 100 dicts array | 1.00 | 1.00 | 0.79 | 0.76 | 1.00 | 1.55 | **0.20** | 0.96 | 6.73 | 1.53 |
11
11
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
12
- | 256 Trues array | 1.00 | 1.01 | 1.18 | 1.00 | 1.07 | 2.62 | **0.36** | 1.56 | 2.95 | 2.60 |
12
+ | 256 Trues array | 1.00 | 0.99 | 1.17 | 1.10 | 1.08 | 1.78 | **0.30** | 1.62 | 2.99 | 1.78 |
13
13
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
14
- | 256 ascii array | 1.00 | 1.00 | 1.01 | 1.00 | 1.00 | 0.90 | **0.09** | 0.47 | 1.05 | 0.90 |
14
+ | 256 ascii array | 1.00 | 1.00 | 1.01 | 1.00 | 1.00 | 1.04 | **0.09** | 0.54 | 1.18 | 1.04 |
15
15
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
16
- | 256 doubles array | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.91 | **0.04** | 0.22 | 0.95 | 0.92 |
16
+ | 256 doubles array | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.93 | **0.06** | 0.31 | 1.06 | 0.93 |
17
17
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
18
- | 256 unicode array | 1.00 | 0.80 | 0.79 | 0.82 | 0.80 | 0.68 | **0.02** | 0.52 | 0.66 | 0.68 |
18
+ | 256 unicode array | 1.00 | 0.99 | 1.01 | 1.00 | 0.99 | 0.77 | **0.02** | 0.62 | 0.78 | 0.77 |
19
19
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
20
- | apache.json | 1.00 | 1.00 | 1.00 | 1.00 | 1.01 | 1.70 | **0.19** | 1.02 | 3.29 | 1.68 |
20
+ | apache.json | 1.00 | 0.99 | 0.99 | 0.99 | 0.99 | 1.34 | **0.18** | 1.24 | 3.15 | 1.34 |
21
21
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
22
- | canada.json | 1.00 | 1.00 | 0.98 | 0.99 | 1.00 | 1.04 | **0.06** | 0.27 | 1.81 | 1.05 |
22
+ | canada.json | 1.00 | 1.00 | 0.99 | 0.99 | 1.01 | 1.03 | **0.09** | 0.36 | 1.91 | 1.02 |
23
23
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
24
- | complex object | 1.00 | 1.00 | 0.89 | 0.88 | 1.00 | 1.55 | **0.17** | 0.66 | 2.68 | 1.54 |
24
+ | complex object | 1.00 | 1.00 | 0.90 | 0.89 | 1.01 | 1.25 | **0.17** | 0.80 | 2.92 | 1.24 |
25
25
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
26
- | composite object | 1.00 | 0.99 | 0.68 | 0.64 | 0.98 | 1.70 | **0.21** | 0.83 | 2.48 | 1.72 |
26
+ | composite object | 1.00 | 0.98 | 0.72 | 0.70 | 0.98 | 1.43 | **0.20** | 0.97 | 2.68 | 1.43 |
27
27
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
28
- | ctm.json | 1.00 | 1.00 | 0.75 | 0.75 | 1.00 | 2.27 | **0.21** | 1.11 | 6.56 | 2.27 |
28
+ | ctm.json | 1.00 | 0.97 | 0.72 | 0.72 | 0.97 | 1.37 | **0.21** | 1.26 | 5.89 | 1.35 |
29
29
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
30
- | github.json | 1.00 | 1.00 | 0.97 | 0.96 | 1.00 | 1.38 | **0.16** | 0.86 | 2.10 | 1.39 |
30
+ | github.json | 1.00 | 1.00 | 0.97 | 0.96 | 1.00 | 1.13 | **0.14** | 1.00 | 2.13 | 1.13 |
31
31
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
32
- | instruments.json | 1.00 | 1.00 | 0.74 | 0.74 | 1.00 | 1.81 | **0.20** | 0.90 | 2.86 | 1.81 |
32
+ | instruments.json | 1.00 | 0.99 | 0.76 | 0.76 | 0.99 | 1.31 | **0.19** | 1.04 | 2.82 | 1.30 |
33
33
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
34
- | mesh.json | 1.00 | 1.00 | 0.89 | 0.89 | 1.00 | 0.94 | **0.10** | 0.28 | 1.19 | 0.94 |
34
+ | mesh.json | 1.00 | 1.00 | 0.88 | 0.88 | 1.00 | 0.92 | **0.12** | 0.38 | 1.21 | 0.93 |
35
35
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
36
- | truenull.json | 1.00 | 1.02 | 1.06 | 1.03 | 1.03 | 2.13 | **0.28** | 1.76 | 2.12 | 2.21 |
36
+ | truenull.json | 1.00 | 1.00 | 1.06 | 1.00 | 1.01 | 1.23 | **0.28** | 1.80 | 2.22 | 1.22 |
37
37
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
38
- | tweet.json | 1.00 | 1.00 | 0.99 | 0.93 | 1.00 | 1.70 | **0.20** | 0.91 | 2.70 | 1.69 |
38
+ | tweet.json | 1.00 | 1.00 | 0.98 | 0.94 | 1.00 | 1.32 | **0.19** | 1.02 | 2.73 | 1.32 |
39
39
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
40
- | twitter.json | 1.00 | 1.00 | 0.95 | 0.95 | 1.00 | 1.46 | **0.18** | 0.94 | 2.02 | 1.46 |
40
+ | twitter.json | 1.00 | 1.00 | 0.95 | 0.94 | 1.00 | 1.07 | **0.16** | 1.01 | 1.97 | 1.08 |
41
41
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
42
- | overall | 1.00 | 1.00 | 0.80 | 0.80 | 1.00 | 1.85 | **0.14** | 0.68 | 4.63 | 1.92 |
42
+ | overall | 1.00 | 1.00 | 0.79 | 0.79 | 1.00 | 1.25 | **0.13** | 0.79 | 4.46 | 1.25 |
43
43
  +-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
44
44
 
45
45
  Deserialization
@@ -48,41 +48,41 @@ Deserialization
48
48
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
49
49
  | deserialize | ``loads()``\ [11]_ | ``Decoder()``\ [12]_ | ``loads(n)``\ [13]_ | ``Decoder(n)``\ [14]_ | ``PyDecoder()``\ [15]_ | simdjson | orjson | ujson | simplejson | stdlib |
50
50
  +=======================+========================+========================+========================+========================+========================+========================+========================+========================+========================+========================+
51
- | 100 arrays dict | 1.00 | 1.01 | 0.98 | 0.93 | 1.59 | 0.86 | **0.56** | 0.85 | 1.20 | 0.94 |
51
+ | 100 arrays dict | 1.00 | 1.00 | 0.89 | 0.88 | 1.29 | 0.81 | **0.52** | 0.89 | 1.06 | 0.95 |
52
52
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
53
- | 100 dicts array | 1.00 | 1.00 | 0.87 | 0.86 | 1.58 | 0.62 | **0.36** | 0.69 | 1.35 | 1.00 |
53
+ | 100 dicts array | 1.00 | 1.00 | 0.86 | 0.84 | 1.50 | 0.64 | **0.38** | 0.77 | 1.36 | 1.05 |
54
54
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
55
- | 256 Trues array | 1.00 | 1.02 | 1.08 | 0.98 | 1.14 | 0.93 | **0.42** | 0.96 | 1.53 | 1.37 |
55
+ | 256 Trues array | 1.00 | 1.01 | 1.08 | 1.05 | 1.13 | 0.93 | **0.36** | 0.93 | 1.39 | 1.31 |
56
56
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
57
- | 256 ascii array | 1.00 | 1.00 | 0.99 | 0.99 | 1.50 | 0.50 | **0.33** | 0.85 | 0.86 | 0.77 |
57
+ | 256 ascii array | 1.00 | 1.00 | 1.01 | 0.99 | 1.67 | 0.63 | **0.48** | 1.28 | 1.23 | 1.11 |
58
58
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
59
- | 256 doubles array | 1.00 | 1.00 | 0.26 | 0.26 | 1.01 | 0.21 | **0.16** | 0.61 | 1.08 | 1.03 |
59
+ | 256 doubles array | 1.00 | 1.01 | 0.23 | 0.23 | 1.01 | 0.20 | **0.17** | 0.61 | 1.08 | 1.12 |
60
60
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
61
- | 256 unicode array | 1.00 | 1.00 | 1.00 | 1.00 | 1.07 | 1.12 | **0.41** | 0.82 | 4.06 | 1.45 |
61
+ | 256 unicode array | 1.00 | 1.00 | 1.01 | 1.00 | 1.04 | 1.04 | **0.41** | 0.77 | 4.53 | 1.37 |
62
62
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
63
- | apache.json | 1.00 | 1.00 | 1.01 | 1.01 | 1.57 | 0.68 | **0.44** | 0.79 | 0.84 | 0.82 |
63
+ | apache.json | 1.00 | 1.01 | 1.00 | 1.00 | 1.45 | 0.72 | **0.49** | 0.95 | 0.98 | 0.90 |
64
64
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
65
- | canada.json | 1.00 | 1.00 | 0.33 | 0.33 | 1.12 | 0.29 | **0.25** | 0.54 | 0.97 | 0.96 |
65
+ | canada.json | 1.00 | 1.00 | 0.34 | 0.35 | 1.07 | 0.31 | **0.28** | 0.59 | 1.06 | 1.04 |
66
66
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
67
- | complex object | 1.00 | 1.00 | 0.84 | 0.83 | 1.31 | 0.68 | **0.35** | 0.78 | 1.15 | 0.96 |
67
+ | complex object | 1.00 | 1.00 | 0.81 | 0.83 | 1.25 | 0.60 | **0.38** | 0.84 | 1.10 | 0.97 |
68
68
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
69
- | composite object | 1.00 | 1.00 | 0.84 | 0.83 | 1.34 | 0.61 | **0.39** | 0.59 | 1.45 | 1.07 |
69
+ | composite object | 1.00 | 1.01 | 0.84 | 0.83 | 1.34 | 0.62 | **0.44** | 0.66 | 1.34 | 1.05 |
70
70
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
71
- | ctm.json | 1.00 | 0.99 | 0.93 | 0.93 | 1.48 | 0.80 | **0.53** | 1.13 | 1.20 | 0.97 |
71
+ | ctm.json | 1.00 | 1.00 | 0.89 | 0.89 | 1.36 | 0.81 | **0.54** | 1.21 | 1.15 | 1.32 |
72
72
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
73
- | github.json | 1.00 | 1.00 | 0.99 | 0.98 | 1.37 | 0.66 | **0.39** | 0.77 | 0.91 | 0.82 |
73
+ | github.json | 1.00 | 1.02 | 0.98 | 0.97 | 1.31 | 0.73 | **0.45** | 0.91 | 1.01 | 0.90 |
74
74
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
75
- | instruments.json | 1.00 | 1.00 | 0.87 | 0.87 | 1.23 | 0.66 | **0.36** | 0.76 | 1.17 | 0.94 |
75
+ | instruments.json | 1.00 | 1.01 | 0.83 | 0.83 | 1.19 | 0.62 | **0.35** | 0.73 | 1.02 | 0.90 |
76
76
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
77
- | mesh.json | 1.00 | 1.00 | 0.52 | 0.51 | 1.04 | 0.43 | **0.33** | 0.66 | 1.48 | 1.04 |
77
+ | mesh.json | 1.00 | 1.00 | 0.50 | 0.50 | 1.01 | 0.44 | **0.36** | 0.70 | 1.26 | 1.13 |
78
78
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
79
- | truenull.json | 1.00 | 1.01 | 1.01 | 0.99 | 1.01 | 0.58 | **0.34** | 0.87 | 0.99 | 0.95 |
79
+ | truenull.json | 1.00 | 1.01 | 1.01 | 1.00 | 1.02 | 0.95 | **0.29** | 0.88 | 0.96 | 0.92 |
80
80
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
81
- | tweet.json | 1.00 | 1.01 | 0.99 | 0.97 | 1.30 | 0.69 | **0.39** | 0.84 | 1.17 | 0.99 |
81
+ | tweet.json | 1.00 | 1.00 | 0.97 | 0.96 | 1.27 | 0.72 | **0.44** | 0.98 | 1.25 | 1.04 |
82
82
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
83
- | twitter.json | 1.00 | 1.00 | 0.97 | 0.97 | 1.25 | 0.68 | **0.39** | 0.85 | 0.99 | 0.89 |
83
+ | twitter.json | 1.00 | 1.00 | 0.96 | 0.96 | 1.20 | 0.75 | **0.44** | 0.98 | 1.04 | 1.09 |
84
84
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
85
- | overall | 1.00 | 1.01 | 0.91 | 0.87 | 1.54 | 0.80 | **0.53** | 0.82 | 1.19 | 0.94 |
85
+ | overall | 1.00 | 1.00 | 0.84 | 0.83 | 1.27 | 0.76 | **0.49** | 0.87 | 1.07 | 0.96 |
86
86
  +-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
87
87
 
88
88
  ASCII vs UTF-8 Serialization
@@ -91,11 +91,11 @@ ASCII vs UTF-8 Serialization
91
91
  +-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
92
92
  | serialize | ``rj ascii``\ [16]_ | ``rj utf8``\ [17]_ | ``uj ascii``\ [18]_ | ``uj utf8``\ [19]_ | ``sj ascii``\ [20]_ | ``sj utf8``\ [21]_ | ``json ascii``\ [22]_ | ``json utf8``\ [23]_ |
93
93
  +=========================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+
94
- | Long ASCII string | 1.00 | 0.43 | **0.24** | 0.29 | 0.60 | 1.24 | 0.57 | 1.00 |
94
+ | Long ASCII string | 1.00 | 0.52 | **0.29** | 0.36 | 0.73 | 0.81 | 0.73 | 1.43 |
95
95
  +-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
96
- | Long Unicode string | 1.00 | 0.57 | 0.64 | **0.47** | 0.72 | 0.62 | 0.76 | 0.48 |
96
+ | Long Unicode string | 1.00 | 0.57 | 0.62 | **0.47** | 0.69 | 0.53 | 0.73 | 0.57 |
97
97
  +-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
98
- | overall | 1.00 | 0.53 | 0.51 | **0.41** | 0.68 | 0.82 | 0.70 | 0.65 |
98
+ | overall | 1.00 | 0.56 | 0.53 | **0.44** | 0.70 | 0.61 | 0.73 | 0.80 |
99
99
  +-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
100
100
 
101
101
  .. [1] ``rapidjson.dumps()``
@@ -103,11 +103,11 @@ ASCII vs UTF-8 Serialization
103
103
  .. [3] ``rapidjson.dumps(number_mode=NM_NATIVE)``
104
104
  .. [4] ``rapidjson.Encoder(number_mode=NM_NATIVE)``
105
105
  .. [5] ``rapidjson.Encoder()`` subclassed in Python with *no-op* hook methods
106
- .. [6] `simdjson 3.6.4 <https://pypi.org/project/pysimdjson/>`__
107
- .. [7] `orjson 3.10.5 <https://pypi.org/project/orjson/3.10.5/>`__
106
+ .. [6] `simdjson 3.12.3 <https://pypi.org/project/pysimdjson/>`__
107
+ .. [7] `orjson 3.10.18 <https://pypi.org/project/orjson/3.10.18/>`__
108
108
  .. [8] `ujson 5.10.0 <https://pypi.org/project/ujson/5.10.0/>`__
109
- .. [9] `simplejson 3.19.2 <https://pypi.org/pypi/simplejson/3.19.2>`__
110
- .. [10] Python 3.11.9 standard library ``json``
109
+ .. [9] `simplejson 3.20.1 <https://pypi.org/pypi/simplejson/3.20.1>`__
110
+ .. [10] Python 3.13.5 standard library ``json``
111
111
  .. [11] ``rapidjson.loads()``
112
112
  .. [12] ``rapidjson.Decoder()``
113
113
  .. [13] ``rapidjson.loads(number_mode=NM_NATIVE)``
@@ -1,10 +1,37 @@
1
1
  Changes
2
2
  -------
3
3
 
4
+ 1.22 (2025-10-21)
5
+ ~~~~~~~~~~~~~~~~~
6
+
7
+ * Generate wheels on PyPI using Python 3.14 final release, thanks to cibuildwheel `3.2.1`__
8
+
9
+ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v321
10
+
11
+
12
+ 1.21 (2025-07-10)
13
+ ~~~~~~~~~~~~~~~~~
14
+
15
+ * Use `current master`__ version of rapidjson, thanks to Kyle Gottfried (although I didn't
16
+ merge his `PR #224`__)
17
+
18
+ __ https://github.com/Tencent/rapidjson/compare/ab1842a2dae061284c0a62dca1cc6d5e7e37e346..24b5e7a8b27f42fa16b96fc70aade9106cf7102f
19
+ __ https://github.com/python-rapidjson/python-rapidjson/pull/224
20
+
21
+ * Recompute comparison table with latest versions of other libraries, using Python 3.13
22
+
23
+ * Typing stubs: specify default value for ``stream`` argument of ``Encoder.__call__()``
24
+ (`issue #215`__)
25
+
26
+ __ https://github.com/python-rapidjson/python-rapidjson/issues/215
27
+
28
+ * Use more recent OS images on GH Actions to test and build wheels
29
+
30
+
4
31
  1.20 (2024-08-05)
5
32
  ~~~~~~~~~~~~~~~~~
6
33
 
7
- * Rectify type hints if ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
34
+ * Rectify type hints of ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
8
35
 
9
36
  __ https://github.com/python-rapidjson/python-rapidjson/issues/214
10
37
 
@@ -2,7 +2,7 @@
2
2
  .. :Project: python-rapidjson -- Quickstart examples
3
3
  .. :Author: Lele Gaifax <lele@metapensiero.it>
4
4
  .. :License: MIT License
5
- .. :Copyright: © 2016, 2017, 2018, 2020, 2021 Lele Gaifax
5
+ .. :Copyright: © 2016, 2017, 2018, 2020, 2021, 2025 Lele Gaifax
6
6
  ..
7
7
 
8
8
  =============
@@ -158,6 +158,25 @@ The module exposes also a *stream* interface:
158
158
  >>> load(stream) == data
159
159
  True
160
160
 
161
+ Almost all these functionalities are also available as *classes*. For example, the
162
+ following uses a *relaxed syntax* :class:`~rapidjson.Decoder` instance, that handles
163
+ JSONC__ and *trailing commas*:
164
+
165
+ __ https://jsonc.org/
166
+
167
+ .. code-block:: python
168
+
169
+ >>> from rapidjson import Decoder
170
+ >>> from rapidjson import PM_COMMENTS, PM_TRAILING_COMMAS
171
+ >>> decoder = Decoder(parse_mode=PM_COMMENTS | PM_TRAILING_COMMAS)
172
+ >>> decoder('''
173
+ ... {
174
+ ... "bar": /* Block comment */ "baz",
175
+ ... "foo":100, // Trailing comma and comment
176
+ ... }
177
+ ... ''')
178
+ {'bar': 'baz', 'foo': 100}
179
+
161
180
 
162
181
  Incompatibilities
163
182
  -----------------
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-rapidjson
3
- Version: 1.20
3
+ Version: 1.22
4
4
  Summary: Python wrapper around rapidjson
5
5
  Home-page: https://github.com/python-rapidjson/python-rapidjson
6
6
  Author: Ken Robbins
@@ -8,29 +8,42 @@ Author-email: ken@kenrobbins.com
8
8
  Maintainer: Lele Gaifax
9
9
  Maintainer-email: lele@metapensiero.it
10
10
  License: MIT License
11
- Keywords: json rapidjson
11
+ Keywords: json jsonc rapidjson
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Programming Language :: C++
16
15
  Classifier: Programming Language :: Python :: 3 :: Only
17
16
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
20
18
  Classifier: Programming Language :: Python :: 3.10
21
19
  Classifier: Programming Language :: Python :: 3.11
22
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
23
  Classifier: Programming Language :: Python
24
24
  Requires-Python: >=3.6
25
25
  Description-Content-Type: text/x-rst
26
26
  License-File: LICENSE
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+ Dynamic: maintainer
37
+ Dynamic: maintainer-email
38
+ Dynamic: requires-python
39
+ Dynamic: summary
27
40
 
28
41
  .. -*- coding: utf-8 -*-
29
42
  .. :Project: python-rapidjson -- Introduction
30
43
  .. :Author: Ken Robbins <ken@kenrobbins.com>
31
44
  .. :License: MIT License
32
45
  .. :Copyright: © 2015 Ken Robbins
33
- .. :Copyright: © 2016, 2017, 2018, 2020, 2022 Lele Gaifax
46
+ .. :Copyright: © 2016, 2017, 2018, 2020, 2022, 2024, 2025 Lele Gaifax
34
47
  ..
35
48
 
36
49
  ==================
@@ -102,6 +115,26 @@ Basic usage looks like this:
102
115
  Chunk: b'":"ba'
103
116
  Chunk: b'z"}'
104
117
 
118
+ Most functionalities are exposed both as *functions* and as *classes*.
119
+
120
+ The following uses a *relaxed syntax* ``Decoder`` instance, that handles JSONC__ and
121
+ *trailing commas*:
122
+
123
+ __ https://jsonc.org/
124
+
125
+ .. code-block:: python
126
+
127
+ >>> from rapidjson import Decoder
128
+ >>> from rapidjson import PM_COMMENTS, PM_TRAILING_COMMAS
129
+ >>> decoder = Decoder(parse_mode=PM_COMMENTS | PM_TRAILING_COMMAS)
130
+ >>> decoder('''
131
+ ... {
132
+ ... "bar": /* Block comment */ "baz",
133
+ ... "foo":100, // Trailing comma and comment
134
+ ... }
135
+ ... ''')
136
+ {'bar': 'baz', 'foo': 100}
137
+
105
138
 
106
139
  Development
107
140
  -----------
@@ -135,7 +168,7 @@ Performance
135
168
  ``python-rapidjson`` tries to be as performant as possible while staying
136
169
  compatible with the ``json`` module.
137
170
 
138
- See the `this section`__ in the documentation for a comparison with other JSON libraries.
171
+ See `this section`__ in the documentation for a comparison with other JSON libraries.
139
172
 
140
173
  __ https://python-rapidjson.readthedocs.io/en/latest/benchmarks.html
141
174
 
@@ -155,10 +188,37 @@ __ https://python-rapidjson.readthedocs.io/en/latest/quickstart.html#incompatibi
155
188
  Changes
156
189
  -------
157
190
 
191
+ 1.22 (2025-10-21)
192
+ ~~~~~~~~~~~~~~~~~
193
+
194
+ * Generate wheels on PyPI using Python 3.14 final release, thanks to cibuildwheel `3.2.1`__
195
+
196
+ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v321
197
+
198
+
199
+ 1.21 (2025-07-10)
200
+ ~~~~~~~~~~~~~~~~~
201
+
202
+ * Use `current master`__ version of rapidjson, thanks to Kyle Gottfried (although I didn't
203
+ merge his `PR #224`__)
204
+
205
+ __ https://github.com/Tencent/rapidjson/compare/ab1842a2dae061284c0a62dca1cc6d5e7e37e346..24b5e7a8b27f42fa16b96fc70aade9106cf7102f
206
+ __ https://github.com/python-rapidjson/python-rapidjson/pull/224
207
+
208
+ * Recompute comparison table with latest versions of other libraries, using Python 3.13
209
+
210
+ * Typing stubs: specify default value for ``stream`` argument of ``Encoder.__call__()``
211
+ (`issue #215`__)
212
+
213
+ __ https://github.com/python-rapidjson/python-rapidjson/issues/215
214
+
215
+ * Use more recent OS images on GH Actions to test and build wheels
216
+
217
+
158
218
  1.20 (2024-08-05)
159
219
  ~~~~~~~~~~~~~~~~~
160
220
 
161
- * Rectify type hints if ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
221
+ * Rectify type hints of ``loads()`` and ``Decoder.__call__()`` (`issue #214`__)
162
222
 
163
223
  __ https://github.com/python-rapidjson/python-rapidjson/issues/214
164
224
 
@@ -3,13 +3,13 @@ CHANGES.rst
3
3
  LICENSE
4
4
  MANIFEST.in
5
5
  README.rst
6
+ rapidjson.cpp
6
7
  rapidjson_exact_version.txt
7
8
  requirements-test.txt
8
9
  requirements.txt
9
10
  setup.cfg
10
11
  setup.py
11
12
  tox.ini
12
- version.txt
13
13
  ./rapidjson.cpp
14
14
  benchmarks/conftest.py
15
15
  benchmarks/tablize.py
@@ -2445,13 +2445,14 @@ private:
2445
2445
  data_.f.flags = kShortStringFlag;
2446
2446
  data_.ss.SetLength(s.length);
2447
2447
  str = data_.ss.str;
2448
+ std::memmove(str, s, s.length * sizeof(Ch));
2448
2449
  } else {
2449
2450
  data_.f.flags = kCopyStringFlag;
2450
2451
  data_.s.length = s.length;
2451
2452
  str = static_cast<Ch *>(allocator.Malloc((s.length + 1) * sizeof(Ch)));
2452
2453
  SetStringPointer(str);
2454
+ std::memcpy(str, s, s.length * sizeof(Ch));
2453
2455
  }
2454
- std::memcpy(str, s, s.length * sizeof(Ch));
2455
2456
  str[s.length] = '\0';
2456
2457
  }
2457
2458
 
@@ -177,10 +177,10 @@ struct UTF8 {
177
177
 
178
178
  template <typename InputStream, typename OutputStream>
179
179
  static bool Validate(InputStream& is, OutputStream& os) {
180
- #define RAPIDJSON_COPY() os.Put(c = is.Take())
180
+ #define RAPIDJSON_COPY() if (c != '\0') os.Put(c = is.Take())
181
181
  #define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
182
182
  #define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70)
183
- Ch c;
183
+ Ch c = static_cast<Ch>(-1);
184
184
  RAPIDJSON_COPY();
185
185
  if (!(c & 0x80))
186
186
  return true;
@@ -134,7 +134,7 @@ inline bool StrtodDiyFp(const Ch* decimals, int dLen, int dExp, double* result)
134
134
  int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999
135
135
  for (; i < dLen; i++) {
136
136
  if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) ||
137
- (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > Ch('5')))
137
+ (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] >= Ch('5')))
138
138
  break;
139
139
  significand = significand * 10u + static_cast<unsigned>(decimals[i] - Ch('0'));
140
140
  }
@@ -28,6 +28,12 @@ RAPIDJSON_DIAG_PUSH
28
28
  RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
29
29
  #endif
30
30
 
31
+ #if defined(RAPIDJSON_CPLUSPLUS) && RAPIDJSON_CPLUSPLUS >= 201703L
32
+ #define RAPIDJSON_IF_CONSTEXPR if constexpr
33
+ #else
34
+ #define RAPIDJSON_IF_CONSTEXPR if
35
+ #endif
36
+
31
37
  RAPIDJSON_NAMESPACE_BEGIN
32
38
 
33
39
  static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
@@ -291,7 +297,7 @@ public:
291
297
  SizeType length = static_cast<SizeType>(end - buffer);
292
298
  buffer[length] = '\0';
293
299
 
294
- if (sizeof(Ch) == 1) {
300
+ RAPIDJSON_IF_CONSTEXPR (sizeof(Ch) == 1) {
295
301
  Token token = { reinterpret_cast<Ch*>(buffer), length, index };
296
302
  return Append(token, allocator);
297
303
  }
@@ -1584,7 +1584,7 @@ private:
1584
1584
  // Parse frac = decimal-point 1*DIGIT
1585
1585
  int expFrac = 0;
1586
1586
  size_t decimalPosition;
1587
- if (Consume(s, '.')) {
1587
+ if (!useNanOrInf && Consume(s, '.')) {
1588
1588
  decimalPosition = s.Length();
1589
1589
 
1590
1590
  if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9')))
@@ -1631,7 +1631,7 @@ private:
1631
1631
 
1632
1632
  // Parse exp = e [ minus / plus ] 1*DIGIT
1633
1633
  int exp = 0;
1634
- if (Consume(s, 'e') || Consume(s, 'E')) {
1634
+ if (!useNanOrInf && (Consume(s, 'e') || Consume(s, 'E'))) {
1635
1635
  if (!useDouble) {
1636
1636
  d = static_cast<double>(use64bit ? i64 : i);
1637
1637
  useDouble = true;
@@ -1645,8 +1645,7 @@ private:
1645
1645
  double qRounded = std::floor(q + 0.5);
1646
1646
  double scaledEpsilon = (q + qRounded) * std::numeric_limits<double>::epsilon();
1647
1647
  double difference = std::abs(qRounded - q);
1648
- bool isMultiple = (difference <= scaledEpsilon)
1649
- || (difference < std::numeric_limits<double>::min());
1648
+ bool isMultiple = difference <= scaledEpsilon || difference < (std::numeric_limits<double>::min)();
1650
1649
  if (!isMultiple) {
1651
1650
  context.error_handler.NotMultipleOf(d, multipleOf_);
1652
1651
  RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
@@ -1762,7 +1761,7 @@ struct TokenHelper {
1762
1761
  template <typename Stack>
1763
1762
  struct TokenHelper<Stack, char> {
1764
1763
  RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
1765
- if (sizeof(SizeType) == 4) {
1764
+ RAPIDJSON_IF_CONSTEXPR (sizeof(SizeType) == 4) {
1766
1765
  char *buffer = documentStack.template Push<char>(1 + 10); // '/' + uint
1767
1766
  *buffer++ = '/';
1768
1767
  const char* end = internal::u32toa(index, buffer);
@@ -0,0 +1 @@
1
+ v1.1.0-763-g24b5e7a8
@@ -4,10 +4,10 @@
4
4
  # :License: MIT License
5
5
  # :Copyright: © 2015 John Anderson
6
6
  # :Copyright: © 2015 Ken Robbins
7
- # :Copyright: © 2015, 2017, 2018, 2021, 2022, 2023 Lele Gaifax
7
+ # :Copyright: © 2015, 2017, 2018, 2021, 2022, 2023, 2024, 2025 Lele Gaifax
8
8
  #
9
9
 
10
- mypy==1.10.0
11
- pytest==7.4.3
12
- pytz==2023.3.post1
13
- sphinx==7.2.6
10
+ mypy==1.16.1
11
+ pytest==8.4.1
12
+ pytz==2025.2
13
+ sphinx==8.2.3
@@ -2,20 +2,20 @@
2
2
  # :Project: python-rapidjson -- Development requirements
3
3
  # :Author: Lele Gaifax <lele@metapensiero.it>
4
4
  # :License: MIT License
5
- # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax
5
+ # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax
6
6
  #
7
7
 
8
8
  -r requirements-test.txt
9
9
 
10
10
  # Needed by make release
11
- metapensiero.tool.bump-version==1.3
12
- readme-renderer==43.0
13
- twine==5.0.0
11
+ bump-my-version==1.2.0
12
+ readme-renderer==44.0
13
+ twine==6.1.0
14
14
 
15
15
  # Needed by make benchmarks-*
16
- pytest-benchmark==4.0.0
16
+ pytest-benchmark==5.1.0
17
17
 
18
- pysimdjson==6.0.2
19
- orjson==3.10.5
20
- simplejson==3.19.2
18
+ pysimdjson==7.0.2
19
+ orjson==3.10.18
20
+ simplejson==3.20.1
21
21
  ujson==5.10.0
@@ -3,7 +3,7 @@
3
3
  # :Author: Ken Robbins <ken@kenrobbins.com>
4
4
  # :License: MIT License
5
5
  # :Copyright: © 2015 Ken Robbins
6
- # :Copyright: © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Lele Gaifax
6
+ # :Copyright: © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax
7
7
  #
8
8
 
9
9
  import os.path
@@ -43,8 +43,8 @@ else:
43
43
  " as explained in the README.rst; in all other cases you may"
44
44
  " want to report the issue.")
45
45
 
46
- with open('version.txt', encoding='utf-8') as f:
47
- VERSION = f.read()
46
+ # Automatically updated by bump-my-version at release time
47
+ VERSION = '1.22'
48
48
 
49
49
  with open('README.rst', encoding='utf-8') as f:
50
50
  LONG_DESCRIPTION = f.read()
@@ -94,7 +94,7 @@ setup(
94
94
  long_description=LONG_DESCRIPTION + '\n\n' + CHANGES,
95
95
  long_description_content_type='text/x-rst',
96
96
  license='MIT License',
97
- keywords='json rapidjson',
97
+ keywords='json jsonc rapidjson',
98
98
  author='Ken Robbins',
99
99
  author_email='ken@kenrobbins.com',
100
100
  maintainer='Lele Gaifax',
@@ -103,15 +103,15 @@ setup(
103
103
  classifiers=[
104
104
  'Development Status :: 5 - Production/Stable',
105
105
  'Intended Audience :: Developers',
106
- 'License :: OSI Approved :: MIT License',
107
106
  'Programming Language :: C++',
108
107
  'Programming Language :: Python :: 3 :: Only',
109
108
  'Programming Language :: Python :: 3',
110
- 'Programming Language :: Python :: 3.8',
111
109
  'Programming Language :: Python :: 3.9',
112
110
  'Programming Language :: Python :: 3.10',
113
111
  'Programming Language :: Python :: 3.11',
114
112
  'Programming Language :: Python :: 3.12',
113
+ 'Programming Language :: Python :: 3.13',
114
+ 'Programming Language :: Python :: 3.14',
115
115
  'Programming Language :: Python',
116
116
  ],
117
117
  ext_modules=[Extension('rapidjson', **extension_options)],
@@ -3,7 +3,7 @@
3
3
  # :Created: dom 10 feb 2019 13:47:32 CET
4
4
  # :Author: Lele Gaifax <lele@metapensiero.it>
5
5
  # :License: MIT License
6
- # :Copyright: © 2019 Lele Gaifax
6
+ # :Copyright: © 2019, 2025 Lele Gaifax
7
7
  #
8
8
 
9
9
  import io
@@ -53,7 +53,8 @@ def test_object_hook_and_default():
53
53
  tracemalloc.stop()
54
54
 
55
55
  for stat in top_stats[:10]:
56
- assert stat.count_diff < 3
56
+ # Uhm, with Py 3.14, on macOS, the diff is 3...
57
+ assert stat.count_diff <= 3
57
58
 
58
59
 
59
60
  def test_load():
@@ -78,7 +79,8 @@ def test_load():
78
79
  tracemalloc.stop()
79
80
 
80
81
  for stat in top_stats[:10]:
81
- assert stat.count_diff < 3
82
+ # Uhm, with Py 3.14, on macOS, the diff is 3...
83
+ assert stat.count_diff <= 3
82
84
 
83
85
 
84
86
  def test_failed_validation():
@@ -121,4 +123,5 @@ def test_failed_validation():
121
123
  tracemalloc.stop()
122
124
 
123
125
  for stat in top_stats[:10]:
124
- assert stat.count_diff < 3
126
+ # Uhm, with Py 3.14, on macOS, the diff is 3...
127
+ assert stat.count_diff <= 3
@@ -2,7 +2,7 @@
2
2
  # :Project: python-rapidjson -- Refs leaks tests
3
3
  # :Author: Lele Gaifax <lele@metapensiero.it>
4
4
  # :License: MIT License
5
- # :Copyright: © 2017, 2018, 2020, 2022 Lele Gaifax
5
+ # :Copyright: © 2017, 2018, 2020, 2022, 2025 Lele Gaifax
6
6
  #
7
7
 
8
8
  # NB: this is a simplistic test that uses sys.gettotalrefcount(), available
@@ -211,10 +211,11 @@ def test_endarray_leak():
211
211
  return list(seq)
212
212
 
213
213
  j1 = rj.loads(value)
214
- assert sys.getrefcount(j1['v']) == 3
214
+ # Uhm, with Py 3.14 the refcount is 2...
215
+ assert 2 <= sys.getrefcount(j1['v']) <= 3
215
216
 
216
217
  j2 = Decoder1()(value)
217
- assert sys.getrefcount(j2['v']) == 3
218
+ assert 2 <= sys.getrefcount(j2['v']) <= 3
218
219
 
219
220
  j3 = Decoder2()(value)
220
- assert sys.getrefcount(j3['v']) == 3
221
+ assert 2 <= sys.getrefcount(j3['v']) <= 3
@@ -215,7 +215,7 @@ class Encoder:
215
215
  def __call__(
216
216
  self,
217
217
  obj: t.Any,
218
- stream: t.Optional[t.IO],
218
+ stream: t.Optional[t.IO] = None,
219
219
  chunk_size: t.Optional[int] = 65536,
220
220
  ) -> t.Optional[str]: ...
221
221
 
@@ -1 +0,0 @@
1
- v1.1.0-752-gab1842a2
@@ -1 +0,0 @@
1
- 1.20
File without changes
File without changes