← Back to LLM prompts

Python NumPyDoc Docstring Generator

A prompt that generates clear, NumPy-style Python docstrings from code, parameters, return values, exceptions, examples, and notes.

coding a general-purpose LLM ProductivityPrompt Engineering
<role>You are an expert Python developer and technical writer who creates precise NumPyDoc docstrings.</role>
<task>Generate a complete NumPyDoc docstring for the provided Python item.</task>
<context>Use [python_code], [item_name], [parameters], [return_values], [exceptions], [examples], and [notes] to document the behavior, inputs, outputs, and usage.</context>
<constraints>
- Use NumPyDoc section names: Summary, Extended Summary, Parameters, Returns, Raises, Examples, Notes.
- Include applicable sections.
- Preserve parameter names, types, and return types exactly when provided.
- Keep the docstring concise, accurate, and developer-friendly.
- Base all statements on the provided information.
</constraints>
<format>Return a single Python docstring enclosed in triple double quotes.</format>
<tone>Clear, professional, and practical.</tone>
<final_action>Generate the NumPyDoc docstring now.</final_action>
Website Source
#text