Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading Python Documentation for 3rd party modules

I recently downloaded IMDbpy module.. When I do,

import imdb
help(imdb)

i dont get the full documentation.. I have to do

im = imdb.IMDb()
help(im)

to see the available methods. I dont like this console interface. Is there any better way of reading the doc. I mean all the doc related to module imdb in one page..

like image 231
Abhijeet Rastogi Avatar asked Dec 22 '22 04:12

Abhijeet Rastogi


2 Answers

Use pydoc

pydoc -w imdb

This will generate imdb.html in the same directory.


pydoc -p 9090 will start a HTTP server on port 9090, and you will be able to browse all documentation at http://localhost:9090/

like image 93
N 1.1 Avatar answered Dec 24 '22 17:12

N 1.1


in IPython you could do

[1]: import os
[2]: os?

< get the full documentation here >

# or you could do it on specific functions 
[3]: os.uname
<built-in function>



[4]: os.uname?

< get the full documentation here >


# Incase of modules written in python, you could inspect source code by doing
[5]: import string
[6]: string??

< hows the source code of the module >

[7]: string.upper??

< shows the source code of the function >
like image 41
Jeffrey Jose Avatar answered Dec 24 '22 17:12

Jeffrey Jose