Subscribe to RSS Feed

Doxygen comments in Python

Feb 27th, 2008 by Joshua Scotton

I’ve been creating automatic documentation for the Entertainer project using Doxygen.
As you may know, Entertainer is written in python, so what follows is a short guide to commenting python code in a format that Doxygen will pick up.

Say you wrote the following:

class Demo:
  def theDemoTest(self, testParameter):
    #do something here
    return 0

You can comment this in Doxygen format in the following way:

class Demo:
"""
This is a description of the Demo class
@author Joshua Scotton
@version 0.1
"""
  def theDemoTest(self, testParameter):
  """
  This is the very, very, very, very, very, very, very, very, very, very long description of theDemoTest!
  @brief This is where you can put a brief description
  @see Demo
  @param testParameter String: Input Parameter is a string
  @return int Returns a 0 if successful
  """
    #do something here
    return 0

Quick Tag List
@author
@brief
@bug
@code and @endcode
@date
@file
@package
@param
@return
@see
@todo
@version
@warning

Post to Twitter Post to Delicious Post to Digg Post to Facebook

Tags: , , ,

11 Responses to “Doxygen comments in Python”

  1. Greg
    March 19, 2008 at 12:13 am

    What filter do you use in DoxyGen to make tags work?

  2. Joshua Scotton
    March 19, 2008 at 12:02 pm

    Hi Greg,

    The setup I use for Doxygen is described in my earlier post at http://www.joshuascotton.com/main/archives/64

    The filter I use is doxypy from http://code.foosel.org/doxypy and I edit the config.dox file to have the following line:

    INPUT_FILTER = “python /path/to/doxypy.py”

    Josh

  3. Recent Faves Tagged With "doxygen" : MyNetFaves
    March 27, 2009 at 12:05 pm

    [...] ago Bugzilla,Doxygen,SVN y otras cosas pichulas First saved by LOCKMANakaAC | 5 days ago Doxygen comments in Python First saved by marleneref | 10 days ago I’m Ready for School to Start First saved by [...]

  4. Adam
    January 8, 2010 at 9:59 pm

    Hey there. Thanks for writing up the instructions.

    I followed your directions, but doxygen is failing for me. If I leave out the doxypy filter (e.g. put nothing in the INPUT_FILTER field) then I can generate documentation fine, just obviously without being able to recognize the tags. If I enable the filter, however, then the generated HTML only displays the Main Page tab (i.e. no Modules). If it matters, I’m using OSX. Any ideas?

  5. Joshua Scotton
    January 8, 2010 at 10:32 pm

    The version I used in the guide was v3 and I haven’t used doxygen for a while. The latest version is v4.2 so it might have changed slightly in the last year. However, here goes…

    Have you got the FILTER_SOURCE_FILES set to YES? Also double check that the path to doxypy.py is correct (it’s probably different to my example on OSX).
    i.e.
    FILTER_SOURCE_FILES = YES
    INPUT_FILTER = “python /usr/local/bin/doxypy.py”

    Also from http://code.foosel.org/doxypy:
    If you want to make Doxygen recognize your module docstrings, you have to add a namespace command to the docstring

  6. Jonathan Rosebaugh
    August 27, 2011 at 4:22 am

    Congratulations on possessing actually one in all one of the crucial sophisticated blogs Ive arrive throughout in some time! Its simply amazing how a lot you’ll have the ability to think about away from a factor basically simply due to how visually stunning it is. Youve place collectively a terrific blog web site area –great graphics, movies, layout. That is definitely a should-see web site!

  7. 3d converter
    October 14, 2011 at 8:07 am

    I predict eBay will be full of them soon

  8. Maryalice Retchless
    October 21, 2011 at 9:53 pm

    I like the helpful information you provide in your articles. I will bookmark your blog and check again here regularly. I’m quite sure I’ll learn a lot of new stuff right here! Best of luck for the next!

  9. acheter ordinateur portable pas cher
    November 19, 2011 at 12:50 pm

    Hello there! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a outstanding job!

  10. Arturo Balfany
    December 5, 2011 at 10:16 pm

    Heya are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any html coding knowledge to make your own blog? Any help would be greatly appreciated!

Leave a Reply

Calendar

February 2012
M T W T F S S
« Dec    
 12345
6789101112
13141516171819
20212223242526
272829