⚡ Cloudflare Python Worker 📦 abbrev v1.4.0

Shortest Unique Abbreviations

Calculate the minimal unique prefix mappings for CLI options, commands, or routes. Powered by the pure-Python abbrev library running globally at the edge.

🔌 Configuration Input

Enter a list of commands, strings, or flags (one per line). The abbreviations will update in real-time as you type.

The minimal unique abbreviation calculated for each word using abbrev logic.

The complete mapping of every valid abbreviation string to its fully resolved target.

Query abbreviations dynamically. Test how ambiguous queries raise KeyErrors or how flags change lookup behavior.

Enter a query to run lookup...

📖 Edge API Endpoint Usage

Deploy this as a microservice on your edge framework to resolve abbreviations instantly in command line tools or routing systems.

POST /api/abbrev

# Request Body: JSON list of strings
curl -X POST https://your-worker.workers.dev/api/abbrev \
  -H "Content-Type: application/json" \
  -d '{"words": ["status", "start", "stop"]}'

# Response Payload
{
  "shortest_mapping": {
    "start": "star",
    "status": "stat",
    "stop": "sto"
  },
  "full_mapping": {
    "sta": "start",
    "star": "start",
    "start": "start",
    "sto": "stop",
    "stop": "stop"
  }
}