or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/us@3.2.x
tile.json

tessl/pypi-us

tessl install tessl/pypi-us@3.2.0

A 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%

task.mdevals/scenario-10/

State Name Fuzzy Matcher

A utility that accepts potentially misspelled US state names from user input and returns the correct state information.

Requirements

Your task is to build a command-line tool that:

  1. Accepts a state name as input (which may contain typos or phonetic variations)
  2. Finds the matching US state even if the input is misspelled
  3. Returns the state's full name and two-letter postal abbreviation
  4. Handles cases where no match can be found

Input/Output Specification

  • The tool should accept a single command-line argument: the state name query
  • If a match is found, output the format: {full_name} ({abbreviation})
  • If no match is found, output: No match found
  • Exit with status code 0 on success, 1 on failure

Test Cases

  • Running with input "california" returns "California (CA)" @test
  • Running with input "Kalifornia" (misspelled) returns "California (CA)" @test
  • Running with input "Murryland" (phonetic variation) returns "Maryland (MD)" @test
  • Running with input "XYZ123" (invalid) returns "No match found" @test

Implementation

@generates

API

def find_state(query: str) -> dict:
    """
    Find a US state based on a potentially misspelled name.

    Args:
        query: The state name to look up (may be misspelled)

    Returns:
        dict with 'name' and 'abbr' keys if found, None if no match
    """
    pass

def main():
    """
    Command-line entry point that reads from sys.argv and prints results.
    """
    pass

Dependencies { .dependencies }

us { .dependency }

A Python library for working with US state and territory metadata. Provides state lookup functionality with phonetic matching support.