json2xml 5.0.3__tar.gz → 5.0.5__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 (36) hide show
  1. {json2xml-5.0.3 → json2xml-5.0.5}/HISTORY.rst +12 -0
  2. {json2xml-5.0.3 → json2xml-5.0.5}/PKG-INFO +14 -1
  3. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml/__init__.py +2 -1
  4. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml/json2xml.py +1 -1
  5. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/PKG-INFO +14 -1
  6. {json2xml-5.0.3 → json2xml-5.0.5}/setup.py +1 -0
  7. {json2xml-5.0.3 → json2xml-5.0.5}/tests/test_json2xml.py +16 -0
  8. {json2xml-5.0.3 → json2xml-5.0.5}/AUTHORS.rst +0 -0
  9. {json2xml-5.0.3 → json2xml-5.0.5}/CONTRIBUTING.rst +0 -0
  10. {json2xml-5.0.3 → json2xml-5.0.5}/LICENSE +0 -0
  11. {json2xml-5.0.3 → json2xml-5.0.5}/MANIFEST.in +0 -0
  12. {json2xml-5.0.3 → json2xml-5.0.5}/README.rst +0 -0
  13. {json2xml-5.0.3 → json2xml-5.0.5}/docs/Makefile +0 -0
  14. {json2xml-5.0.3 → json2xml-5.0.5}/docs/authors.rst +0 -0
  15. {json2xml-5.0.3 → json2xml-5.0.5}/docs/conf.py +0 -0
  16. {json2xml-5.0.3 → json2xml-5.0.5}/docs/contributing.rst +0 -0
  17. {json2xml-5.0.3 → json2xml-5.0.5}/docs/history.rst +0 -0
  18. {json2xml-5.0.3 → json2xml-5.0.5}/docs/index.rst +0 -0
  19. {json2xml-5.0.3 → json2xml-5.0.5}/docs/installation.rst +0 -0
  20. {json2xml-5.0.3 → json2xml-5.0.5}/docs/json2xml.rst +0 -0
  21. {json2xml-5.0.3 → json2xml-5.0.5}/docs/make.bat +0 -0
  22. {json2xml-5.0.3 → json2xml-5.0.5}/docs/modules.rst +0 -0
  23. {json2xml-5.0.3 → json2xml-5.0.5}/docs/readme.rst +0 -0
  24. {json2xml-5.0.3 → json2xml-5.0.5}/docs/usage.rst +0 -0
  25. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml/dicttoxml.py +0 -0
  26. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml/utils.py +0 -0
  27. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/SOURCES.txt +0 -0
  28. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/dependency_links.txt +0 -0
  29. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/not-zip-safe +0 -0
  30. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/requires.txt +0 -0
  31. {json2xml-5.0.3 → json2xml-5.0.5}/json2xml.egg-info/top_level.txt +0 -0
  32. {json2xml-5.0.3 → json2xml-5.0.5}/pyproject.toml +0 -0
  33. {json2xml-5.0.3 → json2xml-5.0.5}/requirements.in +0 -0
  34. {json2xml-5.0.3 → json2xml-5.0.5}/setup.cfg +0 -0
  35. {json2xml-5.0.3 → json2xml-5.0.5}/tests/__init__.py +0 -0
  36. {json2xml-5.0.3 → json2xml-5.0.5}/tests/test_dict2xml.py +0 -0
@@ -1,6 +1,18 @@
1
1
  History
2
2
  =======
3
3
 
4
+ 5.0.5 / 2024-08-31
5
+ ==================
6
+
7
+ * tests (json2xml): add test for encoding
8
+ * fix missing encoding indication on pretty mode (#213)
9
+ * chore(deps): bump webob from 1.8.7 to 1.8.8 in /docs (#212)
10
+
11
+ 5.0.4 / 2024-08-08
12
+ ==================
13
+
14
+ * feat: enforce the version requirements in the correct way
15
+
4
16
  5.0.3 / 2024-08-08
5
17
  ==================
6
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json2xml
3
- Version: 5.0.3
3
+ Version: 5.0.5
4
4
  Summary: Simple Python Library to convert JSON to XML
5
5
  Home-page: https://github.com/vinitkumar/json2xml
6
6
  Author: Vinit Kumar
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
19
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
23
24
  License-File: AUTHORS.rst
@@ -232,6 +233,18 @@ Help and Support to maintain this project
232
233
  History
233
234
  =======
234
235
 
236
+ 5.0.5 / 2024-08-31
237
+ ==================
238
+
239
+ * tests (json2xml): add test for encoding
240
+ * fix missing encoding indication on pretty mode (#213)
241
+ * chore(deps): bump webob from 1.8.7 to 1.8.8 in /docs (#212)
242
+
243
+ 5.0.4 / 2024-08-08
244
+ ==================
245
+
246
+ * feat: enforce the version requirements in the correct way
247
+
235
248
  5.0.3 / 2024-08-08
236
249
  ==================
237
250
 
@@ -2,4 +2,5 @@
2
2
 
3
3
  __author__ = """Vinit Kumar"""
4
4
  __email__ = "mail@vinitkumar.me"
5
- __version__ = "5.0.3"
5
+ __version__ = "5.0.5"
6
+
@@ -42,7 +42,7 @@ class Json2xml:
42
42
  )
43
43
  if self.pretty:
44
44
  try:
45
- result = parseString(xml_data).toprettyxml()
45
+ result = parseString(xml_data).toprettyxml(encoding="UTF-8").decode()
46
46
  except ExpatError:
47
47
  raise InvalidDataError
48
48
  return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json2xml
3
- Version: 5.0.3
3
+ Version: 5.0.5
4
4
  Summary: Simple Python Library to convert JSON to XML
5
5
  Home-page: https://github.com/vinitkumar/json2xml
6
6
  Author: Vinit Kumar
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
19
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10
21
22
  Description-Content-Type: text/x-rst
22
23
  License-File: LICENSE
23
24
  License-File: AUTHORS.rst
@@ -232,6 +233,18 @@ Help and Support to maintain this project
232
233
  History
233
234
  =======
234
235
 
236
+ 5.0.5 / 2024-08-31
237
+ ==================
238
+
239
+ * tests (json2xml): add test for encoding
240
+ * fix missing encoding indication on pretty mode (#213)
241
+ * chore(deps): bump webob from 1.8.7 to 1.8.8 in /docs (#212)
242
+
243
+ 5.0.4 / 2024-08-08
244
+ ==================
245
+
246
+ * feat: enforce the version requirements in the correct way
247
+
235
248
  5.0.3 / 2024-08-08
236
249
  ==================
237
250
 
@@ -49,4 +49,5 @@ setup(
49
49
  url="https://github.com/vinitkumar/json2xml",
50
50
  version=__version__,
51
51
  zip_safe=False,
52
+ python_requires=">=3.10",
52
53
  )
@@ -213,3 +213,19 @@ class TestJson2xml:
213
213
  dict_from_xml = xmltodict.parse(result)
214
214
  assert dict_from_xml["all"]["product"]["@attr_name"] == "attr_value"
215
215
  assert dict_from_xml["all"]["product"]["@a"] == "b"
216
+
217
+ def test_encoding_pretty_print(self) -> None:
218
+ data = readfromstring(
219
+ '{"login":"mojombo","id":1,"avatar_url":"https://avatars0.githubusercontent.com/u/1?v=4"}'
220
+ )
221
+ xmldata = json2xml.Json2xml(data, pretty=True).to_xml()
222
+ if xmldata:
223
+ assert 'encoding="UTF-8"' in xmldata
224
+
225
+ def test_encoding_without_pretty_print(self) -> None:
226
+ data = readfromstring(
227
+ '{"login":"mojombo","id":1,"avatar_url":"https://avatars0.githubusercontent.com/u/1?v=4"}'
228
+ )
229
+ xmldata = json2xml.Json2xml(data, pretty=False).to_xml()
230
+ if xmldata:
231
+ assert b'encoding="UTF-8"' in xmldata
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes