Skip to content

Instantly share code, notes, and snippets.

@takotab
Created November 10, 2021 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takotab/8e23c2241a7d158a165380c37330f45c to your computer and use it in GitHub Desktop.
Save takotab/8e23c2241a7d158a165380c37330f45c to your computer and use it in GitHub Desktop.
{{! FastAPI Docstring Template }}
{{summaryPlaceholder}}
{{extendedSummaryPlaceholder}}
```
{{#parametersExist}}
Args:
{{#args}}
{{var}} ({{typePlaceholder}}): {{descriptionPlaceholder}}
{{/args}}
{{#kwargs}}
{{var}} ({{typePlaceholder}}, optional): {{descriptionPlaceholder}}. Defaults to {{&default}}.
{{/kwargs}}
{{/parametersExist}}
{{#exceptionsExist}}
Raises:
{{#exceptions}}
{{type}}: {{descriptionPlaceholder}}
{{/exceptions}}
{{/exceptionsExist}}
{{#returnsExist}}
Returns:
{{#returns}}
{{typePlaceholder}}: {{descriptionPlaceholder}}
{{/returns}}
{{/returnsExist}}
{{#yieldsExist}}
Yields:
{{#yields}}
{{typePlaceholder}}: {{descriptionPlaceholder}}
{{/yields}}
{{/yieldsExist}}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment