Friday, February 18, 2011

Python and Doxygen

Dogygen produces a professional documentation of your source code. Originally wrote for C/C++ source code, it now supports a broader range of language: C, C++, Java, PHP, Python, etc.

Here is a quick howto to get your Python project documented:
  1. download a binary distribution and install it in your system

  2. generate a configuration file template running in a command line console:

    doxygen -g my_project.doxyfile

  3. update the configuration template to match your project folder, and options. So far I have configured the following options only:

    PROJECT_NAME
    PROJECT_NUMBER
    OUTPUT_DIRECTORY (where you want the documentation files to be written)
    EXTRACT_ALL = YES
    EXTRACT_PRIVATE = YES
    EXTRACT_STATIC = YES
    FILE_PATTERNS = *.py
    RECURSIVE = YES
    GENERATE_LATEX = NO

  4. then simply run doxygen with the configuration file as parameter:

    doxygen my_project.doxyfile
Here's some HTML output:

No comments:

Post a Comment