Library of web-related functions for HTML manipulation, HTTP processing, URL handling, and encoding detection
84
{
"context": "This criteria evaluates how effectively the engineer uses the w3lib package's safe_url_string function to sanitize and normalize URLs. The focus is on proper utilization of w3lib's URL safety features rather than implementing custom URL validation or encoding logic.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses safe_url_string",
"description": "Implementation imports and uses the safe_url_string function from w3lib.url module",
"max_score": 40
},
{
"name": "Proper error handling",
"description": "Returns None for invalid inputs (non-strings or malformed URLs) by checking the input type or catching exceptions from safe_url_string",
"max_score": 20
},
{
"name": "Handles special characters",
"description": "Correctly handles URLs with special characters in the path (spaces, non-ASCII) by allowing safe_url_string to perform encoding",
"max_score": 15
},
{
"name": "Supports IDNA",
"description": "Correctly handles internationalized domain names by relying on safe_url_string's built-in IDNA support",
"max_score": 15
},
{
"name": "Handles encoding normalization",
"description": "Correctly handles mixed or incorrect encoding in URL components by using safe_url_string's normalization capabilities",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-w3libevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10