{"uid":"cap_M-ZM44OPnXyCSTAeyDaGf","slug":"api-strale-io-245977f0","name":"Python Docstring Generator (Google/NumPy/Sphinx)","description":"Add Python docstrings to functions and classes. Supports Google, NumPy, and Sphinx styles.","url":"https://api.strale.io/x402/docstring-generate","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"style":{"type":"string","description":"google/numpy/sphinx"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"code":"def calculate_tax(income, rate):\n    return income * rate","style":"google"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0xe4c44c89e846ef457d0f167e0d20f276da5cc17273ec27a1000b96eb92cf054e"},"capability":"docstring-generate","latency_ms":1172,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-13T04:24:01.987Z"}},"style":"google","documented_code":"def calculate_tax(income, rate):\n    \"\"\"Calculates the tax amount based on income and tax rate.\n    \n    Args:\n        income (float): The income amount to calculate tax on.\n        rate (float): The tax rate as a decimal (e.g., 0.15 for 15%).\n    \n    Returns:\n        float: The calculated tax amount.\n    \"\"\"\n    return income * rate","classes_documented":0,"functions_documented":1}},"exampleRequest":{"code":"def calculate_tax(income, rate):\n    return income * rate","style":"google"},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PnXK4D2u8bNuMjX0bElHZ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Automatically generates Python docstrings for functions and classes in Google, NumPy, or Sphinx style.","exampleAgentPrompt":"Can you add Google-style docstrings to this Python function: `def calculate_tax(income, rate): return income * rate`?","exampleUseCases":null,"resultDescription":"Returns generated Python docstring(s) for the submitted code, formatted in the requested style (Google, NumPy, or Sphinx), covering parameters, return values, and descriptions.","failureModes":["Missing required 'code' query parameter returns error","Invalid or non-Python code may produce malformed or empty docstrings","Unsupported style value falls back to default or returns error","Very long code snippets may hit size limits","Network timeout for complex multi-class inputs"],"whenToPreferThis":"Use this endpoint when you need automated, style-consistent Python docstrings generated for functions or classes and want to choose between Google, NumPy, or Sphinx documentation formats. Ideal for CI/CD pipelines, code review automation, or IDE plugins that need per-function documentation on demand.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:07:10.201Z","isFirstParty":false}