Skip to content
BEAD

Python String Escape / Unescape

Escape arbitrary text to a Python string literal — \x, \u, \U, octal — or decode one back to raw text.

Python string literal
</>Use this tool programmaticallycurl · JavaScript · MCP

Same tool, callable from any HTTP client or from Claude (via MCP). Anonymous: 100 req/day per IP. Sign up for 1,000 req/day.

curl
curl https://api.b-e-a-d.com/tools/python-string-escape/run \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "escape",
  "input": "your input here",
  "quote": "single",
  "asciiOnly": false
}'
JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/python-string-escape/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "mode": "escape",
  "input": "your input here",
  "quote": "single",
  "asciiOnly": false
}),
});
const data = await res.json();
console.log(data.result);
MCP (Claude Desktop / Claude Code)
# In Claude Desktop / Claude Code, add to your MCP config:
{
  "mcpServers": {
    "bead": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.b-e-a-d.com"]
    }
  }
}

# Then ask Claude to call:
mcp__bead__bead_python_string_escape

Full reference: developer docs · OpenAPI spec

What gets handled

  • Standard escapes — \n \t \r \v \f \a \b \0 \' \" \\
  • Hex (\xHH) and octal (\OOO)
  • Unicode — \uXXXX and \UXXXXXXXX
  • Named — \N{LATIN SMALL LETTER A} preserved verbatim (no Unicode DB lookup)
  • Raw-string mode (r"…") — escapes pass through unchanged

You might also like