Add `pydoc` command
See original GitHub issueThe standard library has a module pydoc
which can be used for generating and viewing documentation. I suggest a command such as [prefix] pydoc <NAME>
which calls pydoc.doc
with the given name to show instant documentation. I feel like this could be useful when referring to a certain method when helping someone - here’s an example with str.find
:
>>> import io
>>> import pydoc
>>> out = io.StringIO()
>>> pydoc.doc('str.find', output=out)
>>> print(out.getvalue())
Python Library Documentation: method_descriptor in str
str.find = find(...)
S.find(sub[, start[, end]]) -> int
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
for “bigger” documentation such as help(dict)
, this generates quite the long output. It might be a good idea to truncate this or put it into a “pageable embed” (with reactions to move around). Also, I’ve yet to figure out if it’s somehow possible to include a link to the official docs…
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How to get pydoc command working in Windows?
Remember to access pydoc in windows, it's python -m pydoc. If you want to access info on "file", add the word "file" after....
Read more >pydoc — Documentation generator and online help system ...
The pydoc module automatically generates documentation from Python modules. The documentation can be presented as pages of text on the console, served to...
Read more >Documentation generation using the pydoc module in Python
The pydoc module automatically generates documentation from Python modules. The documentation can be saved as pages of text on the console, ...
Read more >Learn How to View Python Documentation Using Pydoc
pydoc - the Python documentation tool pydoc <name> ... Show text documentation on something. <name> may be the name of ...
Read more >Python Docstrings Tutorial : Examples & Format for Pydoc ...
pydoc - the Python documentation tool pydoc <name> ... Show text documentation on something. <name> may be the name of a Python keyword,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, I think the versatility would serve us well - the command will be a lot more useful if we can expand it out that way.
And it’s a great idea to not pollute your environment with packages.
It’s not important that only installed modules work, we can add modules in high demand. The majority of questions asked in our guild can normally be answered with python built-in functions. I’d say pydocs is fine.