CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-titlecase

Python port of John Gruber's titlecase.pl for intelligent title case conversion with style guide compliance

Overall
score

79%

Overview
Eval results
Files

task.mdevals/scenario-2/

Brand Name Formatter

A tool that formats product descriptions and marketing copy by converting text to title case while preserving the special capitalization of brand names and product identifiers.

Capabilities

Formats marketing text with brand preservation

The formatter should convert standard text to title case while maintaining the exact capitalization of brand names like "iPhone", "eBay", and "AT&T".

  • Converts "welcome to ebay's marketplace" to "Welcome to eBay's Marketplace" @test
  • Converts "the new iphone 5 features" to "The New iPhone 5 Features" @test
  • Converts "at&t's new service plan" to "AT&T's New Service Plan" @test

Handles all-caps input differently

When input is entirely in uppercase, the formatter should normalize it to title case without preserving brand capitalization (since intent is unclear from all-caps).

  • Converts "EBAY SELLS IPHONE DEVICES" to "Ebay Sells Iphone Devices" @test

Processes mixed content

The formatter should handle longer text with multiple brand names and standard words.

  • Converts "buy from ebay or visit iTunes for music, available on your iPhone" to "Buy From eBay or Visit iTunes for Music, Available on Your iPhone" @test

Implementation

@generates

API

def format_text(text: str) -> str:
    """
    Converts text to title case while preserving brand name capitalization.

    Args:
        text: The input text to format

    Returns:
        The formatted text with proper title casing and brand preservation
    """
    pass

Dependencies { .dependencies }

titlecase { .dependency }

Provides title case conversion with brand name preservation support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-titlecase

tile.json