tessl install tessl/pypi-us@3.2.0A package for easily working with US and state metadata
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.24x
Baseline
Agent success rate without this tile
71%
Build a utility that validates and categorizes US geographic entities to distinguish between states and territories.
@generates
def is_territory(identifier: str) -> bool:
"""
Check if the given identifier (name or abbreviation) represents a US territory.
Args:
identifier: State/territory name or postal abbreviation (case-insensitive)
Returns:
True if the identifier represents a territory, False otherwise
Raises:
ValueError: If the identifier is not a valid US state or territory
"""
pass
def list_all_territories() -> list[str]:
"""
Return a list of all US territory names in alphabetical order.
Returns:
List of territory names sorted alphabetically
"""
pass
def count_by_type(identifiers: list[str]) -> dict[str, int]:
"""
Count how many states and territories are in the given list.
Args:
identifiers: List of state/territory names or abbreviations
Returns:
Dictionary with keys "states" and "territories" containing counts
Raises:
ValueError: If any identifier is not a valid US state or territory
"""
passProvides US state and territory metadata including territory identification.
@satisfied-by