tessl install tessl/pypi-dnspython@1.16.0DNS toolkit for Python supporting almost all record types with high-level and low-level DNS operations
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.37x
Baseline
Agent success rate without this tile
62%
Build a small library that normalizes and inspects domain names with full IDNA handling.
["Example.com", "bücher.example", "Example.com."] becomes ["example.com.", "xn--bcher-kva.example."] (duplicate removed). @testValueError. @testxn--bcher-kva.example. returning bücher.example. @testapi.eu.Example.com is inside example.com. after normalization (True) and example.net is not. @testmail.bücher.example and bücher.example as xn--bcher-kva.example. (root represented as "." when no shared labels). @test@generates
from collections.abc import Iterable
from typing import List
def normalize_ascii(names: Iterable[str]) -> List[str]:
"""Normalize iterable of domain strings to canonical ASCII with trailing dots, removing duplicates in first-seen order and raising ValueError on invalid input."""
def to_unicode(name: str) -> str:
"""Render a canonical ASCII domain to Unicode with trailing dot preserved."""
def is_subdomain(candidate: str, parent: str) -> bool:
"""Return True if candidate is within parent after normalization, otherwise False."""
def common_suffix(name1: str, name2: str) -> str:
"""Return longest shared suffix of two domains as canonical ASCII with trailing dot (or '.' for the root)."""Provides domain modeling and IDNA conversion utilities.