(xml_text: str)
| 145 | |
| 146 | |
| 147 | def parse_xml(xml_text: str) -> List[Dict[str, str]]: |
| 148 | root = ET.fromstring(xml_text) |
| 149 | nodes = _candidate_nodes(root) |
| 150 | |
| 151 | libs: List[Dict[str, str]] = [] |
| 152 | seen = set() |
| 153 | |
| 154 | for node in nodes: |
| 155 | item = _extract_lib(node) |
| 156 | if not item: |
| 157 | continue |
| 158 | |
| 159 | key = (item["name"].lower(), item["url"].lower()) |
| 160 | if key in seen: |
| 161 | continue |
| 162 | seen.add(key) |
| 163 | libs.append(item) |
| 164 | |
| 165 | libs.sort(key=lambda x: x["name"].lower()) |
| 166 | return libs |
| 167 | |
| 168 | |
| 169 | def fetch_xml(url: str) -> str: |
no test coverage detected