mmar-mapi 1.0.0__py3-none-any.whl → 1.0.2__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.

Potentially problematic release.


This version of mmar-mapi might be problematic. Click here for more details.

mmar_mapi/__init__.py CHANGED
@@ -9,3 +9,4 @@ from .models.enums import MTRSLabelEnum, DiagnosticsXMLTagEnum, MTRSXMLTagEnum,
9
9
  from .models.tracks import TrackInfo, DomainInfo
10
10
  from .models.widget import Widget
11
11
  from .utils import make_session_id
12
+ from .xml_parser import XMLParser
@@ -0,0 +1,18 @@
1
+ import re
2
+ from enum import StrEnum
3
+
4
+
5
+ class XMLParser:
6
+ @staticmethod
7
+ def make_xml(body: str, tag: str | StrEnum) -> str:
8
+ return f"<{tag}>{body}</{tag}>"
9
+
10
+ @staticmethod
11
+ def remove_xml(text: str) -> str:
12
+ re_xml = re.compile(r"<(.*?)>")
13
+ return re.sub(re_xml, "", text).replace(" ", " ").strip()
14
+
15
+ @staticmethod
16
+ def get_tag_list(response: str, tag: str | StrEnum) -> list[str]:
17
+ tag_content = re.findall(f"<{tag}>(.*?)</{tag}>", response, re.DOTALL)
18
+ return [content.lower().strip() for content in tag_content]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mmar-mapi
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Common pure/IO utilities for multi-modal architectures team
5
5
  Keywords:
6
6
  Author: Eugene Tagin
@@ -19,7 +19,7 @@ Classifier: Topic :: Documentation
19
19
  Classifier: Topic :: Software Development
20
20
  Classifier: Topic :: Utilities
21
21
  Classifier: Typing :: Typed
22
- Requires-Dist: pydantic>=2.9.2,<=3.0.0
22
+ Requires-Dist: pydantic~=2.11.7
23
23
  Requires-Python: >=3.12
24
24
  Description-Content-Type: text/markdown
25
25
 
@@ -1,4 +1,4 @@
1
- mmar_mapi/__init__.py,sha256=EUZFZGPHZyrlXo9jVyfk0LRoUm8saSMbwlJH0r1cevI,570
1
+ mmar_mapi/__init__.py,sha256=Qmltu3KlnNYtsgarzz8bUagapY3ILY0nU6VaJnZbQmQ,604
2
2
  mmar_mapi/api.py,sha256=C9Sr8dISvf51xfEznPjccI_odaG4coQE3HI_0jVpjMQ,1677
3
3
  mmar_mapi/file_storage.py,sha256=bwfpoYivOu6uXV5rg2OZQuk8MOpxbT5Zp4TaYD4XjdY,3841
4
4
  mmar_mapi/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,7 +12,8 @@ mmar_mapi/models/tracks.py,sha256=HKDp-BX1p7AlDfSEKfOKCu0TRSK9cD4Dmq1vJt8oRjw,30
12
12
  mmar_mapi/models/widget.py,sha256=KXSP3d4yQNeificMfzRxROdByw9IkxwCjkDD0kc7tcQ,704
13
13
  mmar_mapi/type_union.py,sha256=diwmzcnbqkpGFckPHNw9o8zyQ955mOGNvhTlcBJ0RMI,1905
14
14
  mmar_mapi/utils.py,sha256=hcKJVslvTBLw2vjZ9zcKZxh_tqk48obHcVs_i3Rxn3M,112
15
- mmar_mapi-1.0.0.dist-info/licenses/LICENSE,sha256=2A90w8WjhOgQXnFuUijKJYazaqZ4_NTokYb9Po4y-9k,1061
16
- mmar_mapi-1.0.0.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
17
- mmar_mapi-1.0.0.dist-info/METADATA,sha256=e27-V4h-lNzeHaKOU8txiBFEkdu0snxwY0DBHpOcaek,921
18
- mmar_mapi-1.0.0.dist-info/RECORD,,
15
+ mmar_mapi/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
16
+ mmar_mapi-1.0.2.dist-info/licenses/LICENSE,sha256=2A90w8WjhOgQXnFuUijKJYazaqZ4_NTokYb9Po4y-9k,1061
17
+ mmar_mapi-1.0.2.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
18
+ mmar_mapi-1.0.2.dist-info/METADATA,sha256=48Y5Us8kmdw0_oGfIhNc4DYW8I4Pt5R9zYelBUprzZA,914
19
+ mmar_mapi-1.0.2.dist-info/RECORD,,