MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / parse_amendment_additions

Function parse_amendment_additions

scripts/fetch_eu_mdr_standards.py:227–245  ·  view source on GitHub ↗

Parse 2026/193 amendment to extract new standard entries.

(html: str)

Source from the content-addressed store, hash-verified

225
226
227def parse_amendment_additions(html: str) -> list[dict]:
228 """Parse 2026/193 amendment to extract new standard entries."""
229 soup = BeautifulSoup(html, "html.parser")
230 text = soup.get_text()
231
232 # Find "the following entries are added" section
233 additions = []
234 # Match standard references in the amendment text
235 pattern = r"(EN\s+(?:ISO|IEC)\s+[\d\-]+(?::[\d]+)?(?:/A\d+:[\d]+)?)"
236 matches = re.findall(pattern, text)
237
238 # Remove duplicates while preserving order
239 seen = set()
240 for match in matches:
241 if match not in seen:
242 seen.add(match)
243 additions.append(match)
244
245 return additions
246
247
248def classify_standard(entry: dict) -> str:

Callers 1

fetch_and_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected