json2xml 4.1.0__tar.gz → 5.0.1__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.
- {json2xml-4.1.0 → json2xml-5.0.1}/HISTORY.rst +11 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/PKG-INFO +12 -1
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml/__init__.py +1 -1
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml/dicttoxml.py +2 -2
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml/json2xml.py +2 -2
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml/utils.py +3 -3
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/PKG-INFO +12 -1
- {json2xml-4.1.0 → json2xml-5.0.1}/tests/test_json2xml.py +0 -9
- {json2xml-4.1.0 → json2xml-5.0.1}/AUTHORS.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/CONTRIBUTING.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/LICENSE +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/MANIFEST.in +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/README.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/Makefile +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/authors.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/conf.py +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/contributing.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/history.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/index.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/installation.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/json2xml.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/make.bat +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/modules.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/readme.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/docs/usage.rst +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/SOURCES.txt +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/dependency_links.txt +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/not-zip-safe +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/requires.txt +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/json2xml.egg-info/top_level.txt +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/pyproject.toml +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/requirements.in +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/setup.cfg +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/setup.py +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/tests/__init__.py +0 -0
- {json2xml-4.1.0 → json2xml-5.0.1}/tests/test_dict2xml.py +0 -0
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
History
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
5.0.0 / 2024-05-11
|
|
5
|
+
==================
|
|
6
|
+
|
|
7
|
+
* fix: add python3.12
|
|
8
|
+
* fix: bye bye py 3.9 👋🏻
|
|
9
|
+
* feat:try python3.13
|
|
10
|
+
* chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192)
|
|
11
|
+
* feat: get local working for 3.12 and fix some code quality issue
|
|
12
|
+
* chore(deps): bump certifi from 2022.12.7 to 2023.7.22 in /docs (#183)
|
|
13
|
+
* chore(deps): bump pygments from 2.10.0 to 2.15.0 in /docs (#182)
|
|
14
|
+
|
|
4
15
|
4.1.0 / 2023-11-07
|
|
5
16
|
==================
|
|
6
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: json2xml
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.1
|
|
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,17 @@ Help and Support to maintain this project
|
|
|
233
233
|
History
|
|
234
234
|
=======
|
|
235
235
|
|
|
236
|
+
5.0.0 / 2024-05-11
|
|
237
|
+
==================
|
|
238
|
+
|
|
239
|
+
* fix: add python3.12
|
|
240
|
+
* fix: bye bye py 3.9 👋🏻
|
|
241
|
+
* feat:try python3.13
|
|
242
|
+
* chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192)
|
|
243
|
+
* feat: get local working for 3.12 and fix some code quality issue
|
|
244
|
+
* chore(deps): bump certifi from 2022.12.7 to 2023.7.22 in /docs (#183)
|
|
245
|
+
* chore(deps): bump pygments from 2.10.0 to 2.15.0 in /docs (#182)
|
|
246
|
+
|
|
236
247
|
4.1.0 / 2023-11-07
|
|
237
248
|
==================
|
|
238
249
|
|
|
@@ -14,7 +14,7 @@ class Json2xml:
|
|
|
14
14
|
"""
|
|
15
15
|
def __init__(
|
|
16
16
|
self,
|
|
17
|
-
data:
|
|
17
|
+
data: dict[str, Any] | None = None,
|
|
18
18
|
wrapper: str = "all",
|
|
19
19
|
root: bool = True,
|
|
20
20
|
pretty: bool = True,
|
|
@@ -28,7 +28,7 @@ class Json2xml:
|
|
|
28
28
|
self.root = root
|
|
29
29
|
self.item_wrap = item_wrap
|
|
30
30
|
|
|
31
|
-
def to_xml(self) ->
|
|
31
|
+
def to_xml(self) -> Any | None:
|
|
32
32
|
"""
|
|
33
33
|
Convert to xml using dicttoxml.dicttoxml and then pretty print it.
|
|
34
34
|
"""
|
|
@@ -25,7 +25,7 @@ class StringReadError(Exception):
|
|
|
25
25
|
pass
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def readfromjson(filename: str) ->
|
|
28
|
+
def readfromjson(filename: str) -> dict[str, str]:
|
|
29
29
|
"""Reads a JSON file and returns a dictionary."""
|
|
30
30
|
try:
|
|
31
31
|
with open(filename, encoding="utf-8") as jsondata:
|
|
@@ -36,7 +36,7 @@ def readfromjson(filename: str) -> Dict[str, str]:
|
|
|
36
36
|
raise JSONReadError("Invalid JSON File")
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def readfromurl(url: str, params:
|
|
39
|
+
def readfromurl(url: str, params: dict[str, str] | None = None) -> dict[str, str]:
|
|
40
40
|
"""Loads JSON data from a URL and returns a dictionary."""
|
|
41
41
|
http = urllib3.PoolManager()
|
|
42
42
|
response = http.request("GET", url, fields=params)
|
|
@@ -45,7 +45,7 @@ def readfromurl(url: str, params: Optional[Dict[str, str]] = None) -> Dict[str,
|
|
|
45
45
|
raise URLReadError("URL is not returning correct response")
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def readfromstring(jsondata: str) ->
|
|
48
|
+
def readfromstring(jsondata: str) -> dict[str, str]:
|
|
49
49
|
"""Loads JSON data from a string and returns a dictionary."""
|
|
50
50
|
if not isinstance(jsondata, str):
|
|
51
51
|
raise StringReadError("Input is not a proper JSON string")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: json2xml
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.1
|
|
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,17 @@ Help and Support to maintain this project
|
|
|
233
233
|
History
|
|
234
234
|
=======
|
|
235
235
|
|
|
236
|
+
5.0.0 / 2024-05-11
|
|
237
|
+
==================
|
|
238
|
+
|
|
239
|
+
* fix: add python3.12
|
|
240
|
+
* fix: bye bye py 3.9 👋🏻
|
|
241
|
+
* feat:try python3.13
|
|
242
|
+
* chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192)
|
|
243
|
+
* feat: get local working for 3.12 and fix some code quality issue
|
|
244
|
+
* chore(deps): bump certifi from 2022.12.7 to 2023.7.22 in /docs (#183)
|
|
245
|
+
* chore(deps): bump pygments from 2.10.0 to 2.15.0 in /docs (#182)
|
|
246
|
+
|
|
236
247
|
4.1.0 / 2023-11-07
|
|
237
248
|
==================
|
|
238
249
|
|
|
@@ -50,15 +50,6 @@ class TestJson2xml:
|
|
|
50
50
|
readfromjson("examples/wrongjson.json")
|
|
51
51
|
assert pytest_wrapped_e.type == JSONReadError
|
|
52
52
|
|
|
53
|
-
def test_read_from_url(self):
|
|
54
|
-
data = readfromurl("https://api.publicapis.org/entries")
|
|
55
|
-
assert isinstance(data, dict)
|
|
56
|
-
|
|
57
|
-
def test_read_from_wrong_url(self):
|
|
58
|
-
with pytest.raises(URLReadError) as pytest_wrapped_e:
|
|
59
|
-
readfromurl("https://api.publicapis.org/entriesi")
|
|
60
|
-
assert pytest_wrapped_e.type == URLReadError
|
|
61
|
-
|
|
62
53
|
def test_read_from_jsonstring(self):
|
|
63
54
|
data = readfromstring(
|
|
64
55
|
'{"login":"mojombo","id":1,"avatar_url":"https://avatars0.githubusercontent.com/u/1?v=4"}'
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|