
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to produce documentation for Python functions?
Information about a function or documentation is put in docstrings in a function. The following are the guidelines to be followed while writing the docstrings.
The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type. This line should begin with a capital letter and end with a period.
If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description
Sphinx
Sphinx is the most popular Python documentation tool. It converts reStructuredText markup language into a range of output formats including HTML, LaTeX (for printable PDF versions), manual pages, and plain text.
When run, Sphinx will import your code and using Python’s introspection features it will extract all function, method and class signatures. It will also extract the accompanying docstrings, and compile it all into well-structured and easily readable documentation for your project.
- Related Articles
- How can we call the documentation for NumPy and SciPy?
- How do I create documentation from doc strings in Python?
- How to Generate API Documentation in Postman?
- How to get JShell documentation in Java 9?
- Documentation generation using the pydoc module in Python
- Python Functions creating iterators for efficient looping
- How To Ovaries Produce
- Java documentation comments
- How to run Python functions from command line?
- Java API documentation generator
- How to list all functions in a Python module?
- How to run Python functions in Eclipse command line?
- What are universal functions for n-dimensional arrays in Python?
- Generating MySQL Doxygen Documentation Content
- Testing Documentation in Software Testing
