How to generate a documentation for Python project using pdoc

  • First of all we need to install pydoc using the following command:
  • Then we need to go to the project folder. I recommend you to organize the project using two folders, one for the source code and one for the documentation.
    In my case I have the folder Code and internally I created the folder src with the source code of my project.
  • We need to add the current path to the PYTHONPATH to avoid an error that can occurr when we try to run pdoc.
  • Paste the following command in your terminal:

export PYTHONPATH=”/YOURPATH/”

  • Now we can create the documentation with the following command:

pdoc — html src — html-dir docs

--

--

Computer Science student 🎓👨🏻‍💻🎧

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store