json2xml 5.0.4__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.4 → json2xml-5.0.5}/HISTORY.rst +7 -0
  2. {json2xml-5.0.4 → json2xml-5.0.5}/PKG-INFO +8 -1
  3. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml/__init__.py +1 -1
  4. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml/json2xml.py +1 -1
  5. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/PKG-INFO +8 -1
  6. {json2xml-5.0.4 → json2xml-5.0.5}/tests/test_json2xml.py +16 -0
  7. {json2xml-5.0.4 → json2xml-5.0.5}/AUTHORS.rst +0 -0
  8. {json2xml-5.0.4 → json2xml-5.0.5}/CONTRIBUTING.rst +0 -0
  9. {json2xml-5.0.4 → json2xml-5.0.5}/LICENSE +0 -0
  10. {json2xml-5.0.4 → json2xml-5.0.5}/MANIFEST.in +0 -0
  11. {json2xml-5.0.4 → json2xml-5.0.5}/README.rst +0 -0
  12. {json2xml-5.0.4 → json2xml-5.0.5}/docs/Makefile +0 -0
  13. {json2xml-5.0.4 → json2xml-5.0.5}/docs/authors.rst +0 -0
  14. {json2xml-5.0.4 → json2xml-5.0.5}/docs/conf.py +0 -0
  15. {json2xml-5.0.4 → json2xml-5.0.5}/docs/contributing.rst +0 -0
  16. {json2xml-5.0.4 → json2xml-5.0.5}/docs/history.rst +0 -0
  17. {json2xml-5.0.4 → json2xml-5.0.5}/docs/index.rst +0 -0
  18. {json2xml-5.0.4 → json2xml-5.0.5}/docs/installation.rst +0 -0
  19. {json2xml-5.0.4 → json2xml-5.0.5}/docs/json2xml.rst +0 -0
  20. {json2xml-5.0.4 → json2xml-5.0.5}/docs/make.bat +0 -0
  21. {json2xml-5.0.4 → json2xml-5.0.5}/docs/modules.rst +0 -0
  22. {json2xml-5.0.4 → json2xml-5.0.5}/docs/readme.rst +0 -0
  23. {json2xml-5.0.4 → json2xml-5.0.5}/docs/usage.rst +0 -0
  24. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml/dicttoxml.py +0 -0
  25. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml/utils.py +0 -0
  26. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/SOURCES.txt +0 -0
  27. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/dependency_links.txt +0 -0
  28. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/not-zip-safe +0 -0
  29. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/requires.txt +0 -0
  30. {json2xml-5.0.4 → json2xml-5.0.5}/json2xml.egg-info/top_level.txt +0 -0
  31. {json2xml-5.0.4 → json2xml-5.0.5}/pyproject.toml +0 -0
  32. {json2xml-5.0.4 → json2xml-5.0.5}/requirements.in +0 -0
  33. {json2xml-5.0.4 → json2xml-5.0.5}/setup.cfg +0 -0
  34. {json2xml-5.0.4 → json2xml-5.0.5}/setup.py +0 -0
  35. {json2xml-5.0.4 → json2xml-5.0.5}/tests/__init__.py +0 -0
  36. {json2xml-5.0.4 → json2xml-5.0.5}/tests/test_dict2xml.py +0 -0
@@ -1,6 +1,13 @@
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
+
4
11
  5.0.4 / 2024-08-08
5
12
  ==================
6
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json2xml
3
- Version: 5.0.4
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
@@ -233,6 +233,13 @@ Help and Support to maintain this project
233
233
  History
234
234
  =======
235
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
+
236
243
  5.0.4 / 2024-08-08
237
244
  ==================
238
245
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  __author__ = """Vinit Kumar"""
4
4
  __email__ = "mail@vinitkumar.me"
5
- __version__ = "5.0.4"
5
+ __version__ = "5.0.5"
6
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.4
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
@@ -233,6 +233,13 @@ Help and Support to maintain this project
233
233
  History
234
234
  =======
235
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
+
236
243
  5.0.4 / 2024-08-08
237
244
  ==================
238
245
 
@@ -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
File without changes