reorg ini e log

This commit is contained in:
2025-05-13 22:48:08 +02:00
parent 12ac522b98
commit 976116e2f3
32 changed files with 136 additions and 60 deletions

12
utils/csv/parser.py Normal file
View File

@@ -0,0 +1,12 @@
import re
def extract_value(patterns: list, primary_source: str, secondary_source: str, default='Not Defined') -> str:
"""Extracts the first match for a list of patterns from the primary source.
Falls back to the secondary source if no match is found.
"""
for source in (primary_source, secondary_source):
for pattern in patterns:
matches = re.findall(pattern, source, re.IGNORECASE)
if matches:
return matches[0] # Return the first match immediately
return default # Return default if no matches are found