json2xml 4.0.1__tar.gz → 5.0.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 (38) hide show
  1. {json2xml-4.0.1 → json2xml-5.0.0}/HISTORY.rst +5 -0
  2. {json2xml-4.0.1 → json2xml-5.0.0}/PKG-INFO +8 -3
  3. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml/__init__.py +1 -1
  4. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml/dicttoxml.py +2 -2
  5. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml/json2xml.py +2 -2
  6. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml/utils.py +3 -3
  7. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml.egg-info/PKG-INFO +8 -3
  8. json2xml-5.0.0/json2xml.egg-info/requires.txt +2 -0
  9. json2xml-5.0.0/requirements.in +3 -0
  10. {json2xml-4.0.1 → json2xml-5.0.0}/tests/test_json2xml.py +0 -9
  11. json2xml-4.0.1/json2xml.egg-info/requires.txt +0 -2
  12. json2xml-4.0.1/requirements.in +0 -3
  13. {json2xml-4.0.1 → json2xml-5.0.0}/AUTHORS.rst +0 -0
  14. {json2xml-4.0.1 → json2xml-5.0.0}/CONTRIBUTING.rst +0 -0
  15. {json2xml-4.0.1 → json2xml-5.0.0}/LICENSE +0 -0
  16. {json2xml-4.0.1 → json2xml-5.0.0}/MANIFEST.in +0 -0
  17. {json2xml-4.0.1 → json2xml-5.0.0}/README.rst +0 -0
  18. {json2xml-4.0.1 → json2xml-5.0.0}/docs/Makefile +0 -0
  19. {json2xml-4.0.1 → json2xml-5.0.0}/docs/authors.rst +0 -0
  20. {json2xml-4.0.1 → json2xml-5.0.0}/docs/conf.py +0 -0
  21. {json2xml-4.0.1 → json2xml-5.0.0}/docs/contributing.rst +0 -0
  22. {json2xml-4.0.1 → json2xml-5.0.0}/docs/history.rst +0 -0
  23. {json2xml-4.0.1 → json2xml-5.0.0}/docs/index.rst +0 -0
  24. {json2xml-4.0.1 → json2xml-5.0.0}/docs/installation.rst +0 -0
  25. {json2xml-4.0.1 → json2xml-5.0.0}/docs/json2xml.rst +0 -0
  26. {json2xml-4.0.1 → json2xml-5.0.0}/docs/make.bat +0 -0
  27. {json2xml-4.0.1 → json2xml-5.0.0}/docs/modules.rst +0 -0
  28. {json2xml-4.0.1 → json2xml-5.0.0}/docs/readme.rst +0 -0
  29. {json2xml-4.0.1 → json2xml-5.0.0}/docs/usage.rst +0 -0
  30. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml.egg-info/SOURCES.txt +0 -0
  31. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml.egg-info/dependency_links.txt +0 -0
  32. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml.egg-info/not-zip-safe +0 -0
  33. {json2xml-4.0.1 → json2xml-5.0.0}/json2xml.egg-info/top_level.txt +0 -0
  34. {json2xml-4.0.1 → json2xml-5.0.0}/pyproject.toml +0 -0
  35. {json2xml-4.0.1 → json2xml-5.0.0}/setup.cfg +0 -0
  36. {json2xml-4.0.1 → json2xml-5.0.0}/setup.py +0 -0
  37. {json2xml-4.0.1 → json2xml-5.0.0}/tests/__init__.py +0 -0
  38. {json2xml-4.0.1 → json2xml-5.0.0}/tests/test_dict2xml.py +0 -0
@@ -1,6 +1,11 @@
1
1
  History
2
2
  =======
3
3
 
4
+ 4.1.0 / 2023-11-07
5
+ ==================
6
+
7
+ * chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192, #195)
8
+
4
9
  4.0.1 / 2023-10-13
5
10
  ==================
6
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json2xml
3
- Version: 4.0.1
3
+ Version: 5.0.0
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
@@ -22,8 +22,8 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
24
  License-File: AUTHORS.rst
25
- Requires-Dist: defusedxml==0.7.1
26
- Requires-Dist: urllib3==1.26.13
25
+ Requires-Dist: defusedxml
26
+ Requires-Dist: urllib3
27
27
 
28
28
  ========
29
29
  json2xml
@@ -233,6 +233,11 @@ Help and Support to maintain this project
233
233
  History
234
234
  =======
235
235
 
236
+ 4.1.0 / 2023-11-07
237
+ ==================
238
+
239
+ * chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192, #195)
240
+
236
241
  4.0.1 / 2023-10-13
237
242
  ==================
238
243
 
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """Vinit Kumar"""
4
4
  __email__ = "mail@vinitkumar.me"
5
- __version__ = "4.0.1"
5
+ __version__ = "5.0.0"
@@ -59,11 +59,11 @@ ELEMENT = Union[
59
59
  float,
60
60
  bool,
61
61
  numbers.Number,
62
- Sequence,
62
+ Sequence[str],
63
63
  datetime.datetime,
64
64
  datetime.date,
65
65
  None,
66
- Dict[str, Any],
66
+ dict[str, Any],
67
67
  ]
68
68
 
69
69
 
@@ -14,7 +14,7 @@ class Json2xml:
14
14
  """
15
15
  def __init__(
16
16
  self,
17
- data: Optional[Dict[str, Any]] = None,
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) -> Optional[Any]:
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) -> Dict[str, 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: Optional[Dict[str, str]] = None) -> Dict[str, str]:
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) -> Dict[str, 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: 4.0.1
3
+ Version: 5.0.0
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
@@ -22,8 +22,8 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
24
  License-File: AUTHORS.rst
25
- Requires-Dist: defusedxml==0.7.1
26
- Requires-Dist: urllib3==1.26.13
25
+ Requires-Dist: defusedxml
26
+ Requires-Dist: urllib3
27
27
 
28
28
  ========
29
29
  json2xml
@@ -233,6 +233,11 @@ Help and Support to maintain this project
233
233
  History
234
234
  =======
235
235
 
236
+ 4.1.0 / 2023-11-07
237
+ ==================
238
+
239
+ * chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#192, #195)
240
+
236
241
  4.0.1 / 2023-10-13
237
242
  ==================
238
243
 
@@ -0,0 +1,2 @@
1
+ defusedxml
2
+ urllib3
@@ -0,0 +1,3 @@
1
+ defusedxml
2
+ urllib3
3
+
@@ -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"}'
@@ -1,2 +0,0 @@
1
- defusedxml==0.7.1
2
- urllib3==1.26.13
@@ -1,3 +0,0 @@
1
- defusedxml==0.7.1
2
- urllib3==1.26.13
3
-
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