Baltor Get started

Corner cases

Names, addresses and identifiers

Address line parsing, name capitalisation, company suffixes, email and website repair, postal code formats for 246 countries, and validators with check digits.

11 shown here, each at the exact version the library release of October 9, 2026 serves.

What to watch for

  • Names typed in capitals lose information a rule cannot fully restore, such as McDonald.
  • Postal codes differ by country in length, letters and spacing.
  • Card numbers and securities identifiers carry check digits that catch a mistyped digit.

Test packs and checks

  1. Parse a postal address line into house number

    split_address_lines_into_components

    Parse a postal address line into house number, street, unit, city, region, postal code and country from declared patterns for the United States, Canada and Great Britain, with reasons and a confidence.

    Files
    SKILL.md

    ComponentMIT1 files, 2.9 KBnone declared

  2. Fix the capitalisation of person and company names written in all upper case

    restore_capitalisation_of_names

    Fix the capitalisation of person and company names written in all upper case or all lower case: particles such as van and de, Mc and Mac prefixes, acronyms such as IBM and LLC, with a confidence for each value and review for doubtful ones.

    Files
    SKILL.md

    ComponentMIT1 files, 3.5 KBnone declared

  3. Clean and repair email addresses

    normalize_and_recover_email_addresses

    Clean and repair email addresses: remove mailto and angle brackets, lower the case, repair spelled out at and dot, doubled punctuation and mistyped domains such as gmail.con, and refuse cells with several addresses or an invalid shape.

    Files
    SKILL.md

    ComponentMIT1 files, 2.6 KBnone declared

  4. Normalize website addresses

    normalize_website_addresses

    Normalize website addresses (URLs): add a missing scheme, write the scheme and the host in lower case, optionally remove www, remove a trailing slash, and keep the path, query and fragment exactly as written.

    Files
    SKILL.md

    ComponentMIT1 files, 2.3 KBnone declared

  5. Postal code formats and validation patterns for 246 countries

    postal-codes.json

    Postal code format, validation regex, example and notes for 246 countries by ISO code: 246 rows with a JSON Schema, a checked loader and tests.

    Rows
    246
    Data file
    data/postal-codes.json

    Code moduleMIT8 files, 62.0 KBreads files, runs commands

  6. Postal code formats by country

    postal-formats.csv

    Postal code formats by country: mask, validation regex, example and sample codes: 31 rows with a JSON Schema, a checked loader and tests.

    Rows
    31
    Data file
    data/postal-formats.csv

    Code moduleMIT8 files, 15.6 KBreads files, runs commands

  7. cusip from validators input validation utilities

    cusip

    cusip from validators input validation utilities: Return whether or not given value is a valid CUSIP.

    Function
    cusip
    Project
    validators input validation utilities

    Code moduleMIT6 files, 9.9 KBruns commands

  8. sedol from validators input validation utilities

    sedol

    sedol from validators input validation utilities: Return whether or not given value is a valid SEDOL.

    Function
    sedol
    Project
    validators input validation utilities

    Code moduleMIT6 files, 9.6 KBruns commands

  9. calling_code from validators input validation utilities

    calling_code

    calling_code from validators input validation utilities: Validates given calling code.

    Function
    calling_code
    Project
    validators input validation utilities

    Code moduleMIT6 files, 13.3 KBruns commands

  10. visa from validators input validation utilities

    visa

    visa from validators input validation utilities: Return whether or not given value is a valid Visa card number.

    Function
    visa
    Project
    validators input validation utilities

    Code moduleMIT6 files, 10.2 KBruns commands

Give your agent these components

Your harness downloads them through Baltor with Pro, $49 a month. Cancel any time from your account page.

Get started

More from Corner cases