pydoc3
Python 3 documentation browser
TLDR
View module documentation
$ pydoc3 [module]
Search documentationcopy
$ pydoc3 -k [keyword]
Start documentation servercopy
$ pydoc3 -p [8080]
Write HTML documentationcopy
$ pydoc3 -w [module]
View builtin functioncopy
$ pydoc3 [print]
copy
SYNOPSIS
pydoc3 [options] [name]
DESCRIPTION
pydoc3 is the Python 3 documentation browser. It displays docstrings, module contents, and can generate HTML documentation or serve it via built-in web server.
PARAMETERS
-k keyword
Search for keyword.-p port
Start HTTP server.-b
Open browser to server.-w module
Write HTML file.-n host
Server hostname.
EXAMPLES
$ # View module docs
pydoc3 os
pydoc3 json.loads
# Search for topic
pydoc3 -k sort
# Start doc server
pydoc3 -p 8080
# Then browse http://localhost:8080
# With browser auto-open
pydoc3 -b
# Generate HTML
pydoc3 -w mymodule
pydoc3 os
pydoc3 json.loads
# Search for topic
pydoc3 -k sort
# Start doc server
pydoc3 -p 8080
# Then browse http://localhost:8080
# With browser auto-open
pydoc3 -b
# Generate HTML
pydoc3 -w mymodule
copy
IN PYTHON
$ # Get help in interpreter
help(str.split)
# Same as pydoc
import pydoc
pydoc.doc(str.split)
help(str.split)
# Same as pydoc
import pydoc
pydoc.doc(str.split)
copy
CAVEATS
Shows docstrings, not source. For source, use inspect module. Part of Python standard library.
HISTORY
pydoc is part of the Python standard library, providing documentation access since Python 2.1.