osbot-utils 2.53.0__py3-none-any.whl → 2.54.0__py3-none-any.whl

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.
@@ -1,4 +1,6 @@
1
- from html.parser import HTMLParser
1
+ from html.parser import HTMLParser
2
+ from osbot_utils.helpers.html.Tag__Html import Tag__Html
3
+
2
4
 
3
5
  class Html_To_Dict(HTMLParser):
4
6
  def __init__(self, html):
@@ -72,4 +74,12 @@ class Html_To_Dict(HTMLParser):
72
74
 
73
75
  def print__lines(self, lines):
74
76
  for line in lines:
75
- print(line)
77
+ print(line)
78
+
79
+ def html_to_dict(html_code:str) -> dict:
80
+ try:
81
+ html_to_dict = Html_To_Dict(html_code)
82
+ html_dict = html_to_dict.convert()
83
+ return html_dict
84
+ except: # todo: see if there is a better Exception to capture
85
+ return None # if we couldn't part the html, just return None
@@ -6,4 +6,7 @@ TYPE_SAFE_STR__TEXT__DANGEROUS__REGEX = r'[^a-zA-Z0-9_\s!@#$%^&*()\[\]{}\-+
6
6
 
7
7
  class Safe_Str__Text__Dangerous(Safe_Str):
8
8
  regex = re.compile(TYPE_SAFE_STR__TEXT__DANGEROUS__REGEX)
9
- max_length = TYPE_SAFE_STR__TEXT__DANGEROUS__MAX_LENGTH
9
+ max_length = TYPE_SAFE_STR__TEXT__DANGEROUS__MAX_LENGTH
10
+
11
+
12
+ Safe_Str__HTML = Safe_Str__Text__Dangerous # we can reuse this class for Safe_Str__HTML since the regex and size are the same
@@ -8,6 +8,5 @@ TYPE_SAFE_STR__URL__REGEX = re.compile(r'^(?!https?://).*|[^a-zA-Z0-9:/\-._
8
8
  class Safe_Str__Url(Safe_Str):
9
9
  regex = TYPE_SAFE_STR__URL__REGEX
10
10
  max_length = TYPE_SAFE_STR__URL__MAX_LENGTH
11
- allow_empty = False
12
11
  trim_whitespace = True
13
12
  allow_all_replacement_char = False
osbot_utils/version CHANGED
@@ -1 +1 @@
1
- v2.53.0
1
+ v2.54.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: osbot_utils
3
- Version: 2.53.0
3
+ Version: 2.54.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  License: MIT
6
6
  Author: Dinis Cruz
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
23
23
 
24
24
  Powerful Python util methods and classes that simplify common apis and tasks.
25
25
 
26
- ![Current Release](https://img.shields.io/badge/release-v2.53.0-blue)
26
+ ![Current Release](https://img.shields.io/badge/release-v2.54.0-blue)
27
27
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
28
28
 
29
29
 
@@ -177,7 +177,7 @@ osbot_utils/helpers/generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
177
177
  osbot_utils/helpers/html/Dict_To_Css.py,sha256=u6B4Mx7PXr-gDrTrs1hgknnvsZVK4Fic5LqedKjo-lk,1097
178
178
  osbot_utils/helpers/html/Dict_To_Html.py,sha256=OlRSaDGOeseBNTxRB2ho5whqEacMXeAXWOfeVSEYqC4,3355
179
179
  osbot_utils/helpers/html/Dict_To_Tags.py,sha256=L8O8c0RPzP92EfeACk3pjXJfnlz-Rg38o2Gf9tS2UfM,3745
180
- osbot_utils/helpers/html/Html_To_Dict.py,sha256=6VvPp4RrXxRzPpCTn0HTa6Ywt_-4CBH4sj3aoPBZWIc,2623
180
+ osbot_utils/helpers/html/Html_To_Dict.py,sha256=-dWWz7iDAYvF_pjO7xnio_qRWkDFfRCOiuGNEfqpdQ4,3098
181
181
  osbot_utils/helpers/html/Html_To_Tag.py,sha256=WDdXF0Q9siVwN0OIgZluCu-dXJa8bDrL9-6TidlKUeQ,498
182
182
  osbot_utils/helpers/html/Tag__Base.py,sha256=eAO4SdoKdHe9DRSzf9zpfBhDWDbvv-CGrxjekBHXm8k,3128
183
183
  osbot_utils/helpers/html/Tag__Body.py,sha256=U3UNVs1mNBsJ_kG_-OtwYPi-YzFb4Y2w4vIsvAn0W3g,109
@@ -238,8 +238,8 @@ osbot_utils/helpers/safe_str/Safe_Str__File__Name.py,sha256=ncjkQ2hAhw0a3UulrCuQ
238
238
  osbot_utils/helpers/safe_str/Safe_Str__File__Path.py,sha256=K0yBcvH_Ncqiw7tMqjGqaNyWQh1Zs9qxZ-TR8nEIAow,550
239
239
  osbot_utils/helpers/safe_str/Safe_Str__Hash.py,sha256=Tb2QeVpVDNWpCJGHNFjZPCQ_ZTaI7Z5BDzi19LiO_cI,952
240
240
  osbot_utils/helpers/safe_str/Safe_Str__Text.py,sha256=QxuWqF8hNYdOPDn3Yac86h_1ZaX-THbTBDakberiJcs,313
241
- osbot_utils/helpers/safe_str/Safe_Str__Text__Dangerous.py,sha256=6-fkXBuWgjz70eQicD07f38eEuKqNzJzaFFY6hozhNQ,388
242
- osbot_utils/helpers/safe_str/Safe_Str__Url.py,sha256=5ioWlU0H8kQfmNwpJ5REpFvxAyBBCPFjWHiyXqBGeFg,588
241
+ osbot_utils/helpers/safe_str/Safe_Str__Text__Dangerous.py,sha256=_wxnDiGfYN6CEMn7ZZpWdasBuPU_YvX5MuhEvdUqyrQ,525
242
+ osbot_utils/helpers/safe_str/Safe_Str__Url.py,sha256=4l46AAe5Dy_P_W6d-_3pwtXuehG_Wczq1dC5sOOzg_g,549
243
243
  osbot_utils/helpers/safe_str/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
244
244
  osbot_utils/helpers/sqlite/Capture_Sqlite_Error.py,sha256=GSuRYgs1yKQjxMszPoaI7fsfMfuUqhb64AaIysRE6Cs,1747
245
245
  osbot_utils/helpers/sqlite/Sqlite__Cursor.py,sha256=4Im0pCOiERX6Nnf6iagRlSvTR3CPjyPVkdx4NMQV0P0,3342
@@ -399,8 +399,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
399
399
  osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
400
400
  osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
401
401
  osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
402
- osbot_utils/version,sha256=dP4NljgheSgZk8AOOmmRsf9q_jvd1EAlse1RSgLPF94,8
403
- osbot_utils-2.53.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
404
- osbot_utils-2.53.0.dist-info/METADATA,sha256=yj_jvJ4Y7ldU2hdyK53bGY28vXWtU1wRUQNu79AKHuo,1329
405
- osbot_utils-2.53.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
406
- osbot_utils-2.53.0.dist-info/RECORD,,
402
+ osbot_utils/version,sha256=MHHXtY6fkV6Vpw2VBjof5e9rKL2m_er0M3gBGxN-2z8,8
403
+ osbot_utils-2.54.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
404
+ osbot_utils-2.54.0.dist-info/METADATA,sha256=Vdq0aqhnkpEcMi9EHe8Z_Jav31Ha5kpfTam57SUC_kU,1329
405
+ osbot_utils-2.54.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
406
+ osbot_utils-2.54.0.dist-info/RECORD,,