mmar-mapi 1.0.0__tar.gz → 1.0.2__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.

Potentially problematic release.


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

@@ -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,7 +1,7 @@
1
1
  [project]
2
2
  name = "mmar-mapi"
3
3
  # dynamic version is not supported yet on uv_build
4
- version = "1.0.0"
4
+ version = "1.0.2"
5
5
  description = "Common pure/IO utilities for multi-modal architectures team"
6
6
  authors = [{name = "Eugene Tagin", email = "tagin@airi.net"}]
7
7
  license = "MIT"
@@ -24,7 +24,7 @@ classifiers = [
24
24
  "Typing :: Typed",
25
25
  ]
26
26
  dependencies = [
27
- "pydantic>=2.9.2,<=3.0.0",
27
+ "pydantic~=2.11.7",
28
28
  ]
29
29
 
30
30
  [build-system]
@@ -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]
File without changes
File without changes