INNER CODE UNIT · Python

clean_tool_name

magicsword-io/LOLRMM · bin/generate_domains_csv.py:19

def clean_tool_name(filename):
    """Extract the clean tool name from the file name."""
    # Remove file extension and path
    name = os.path.basename(filename).rsplit(".", 1)[0]

    # Remove parentheses and underscores
    name = re.sub(r"[_()]", " ", name)

    # Handle special characters in filenames
    name = name.replace("__", "_")

    return name.strip()


def should_export_domain(domain):
    """Return True when a Domains value is a real CSV lookup candidate."""
    if not isinstance(domain, str):
        return False

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…