MCPcopy Index your code
hub / github.com/github/gh-aw / SanitizePythonVariableName

Function SanitizePythonVariableName

pkg/stringutil/sanitize.go:275–277  ·  view source on GitHub ↗

SanitizePythonVariableName converts a parameter name to a valid Python identifier by replacing non-alphanumeric characters with underscores. This function ensures that parameter names from workflows can be used safely in Python code by: 1. Replacing any non-alphanumeric characters (except _) with u

(name string)

Source from the content-addressed store, hash-verified

273// SanitizePythonVariableName("123param") // returns "_123param"
274// SanitizePythonVariableName("valid_name") // returns "valid_name"
275func SanitizePythonVariableName(name string) string {
276 return SanitizeIdentifierName(name, nil)
277}
278
279// SanitizeToolID removes common MCP prefixes and suffixes from tool IDs.
280// This cleans up tool identifiers by removing redundant MCP-related naming patterns.

Calls 1

SanitizeIdentifierNameFunction · 0.85