tessl install tessl/pypi-furl@2.1.0URL manipulation made simple.
Agent Success
Agent success rate when using this tile
65%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.59x
Baseline
Agent success rate without this tile
41%
A small utility that parses URLs and returns a structured view of key components. Component maps should infer standard ports for known schemes while leaving the origin and netloc unchanged when no explicit port appears in the input. full_url should match the normalized string form of the input, including credentials and path.
https://user:pass@example.com:8443/path, returns a mapping containing scheme: https, username: user, password: pass, host: example.com, port: 8443, netloc: user:pass@example.com:8443, origin: https://example.com:8443, and full_url matching the input string. @testhttp://example.com/api without an explicit port, fills port with the standard default for the scheme (80), keeps netloc as example.com, leaves origin as http://example.com, and keeps full_url unchanged. @testftp://alice@ftp.example.com/files, records username: alice, password: "", host: ftp.example.com, port: 21, keeps netloc as alice@ftp.example.com, sets origin to ftp://ftp.example.com, and preserves the input string as full_url. @test@generates
from typing import Any, Dict, List, Optional, Union
UrlDetails = Dict[str, Optional[Union[str, int]]]
def describe_url(url: str) -> UrlDetails:
"""Return a mapping with keys: scheme, username, password, host, port, netloc, origin, and full_url."""
def describe_urls(urls: List[str]) -> List[UrlDetails]:
"""Process each URL in order using describe_url and return their component mappings."""Provides URL parsing and composition utilities.