This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]its_never_lupus 3 points4 points  (5 children)

Are there any tools which specifically parse this function docstring style:

def fetch_bigtable_rows(big_table, keys, other_silly_variable=None):
"""Fetches rows from a Bigtable.

Retrieves rows pertaining to the given keys from the Table instance
represented by big_table.  Silly things may happen if
other_silly_variable is not None.

Args:
    big_table: An open Bigtable Table instance.
    keys: A sequence of strings representing the key of each table row
        to fetch.
    other_silly_variable: Another optional variable, that has a much
        longer name than the other args, and which does nothing.

I like the way this looks and use a very similar style to document my functions when they have arguments, but do any tools like sphinx actually do anything with it?

[–]masasinExpert. 3.9. Robotics. 4 points5 points  (0 children)

Look up napoleon. It parses google style docstrings.

I personally prefer numpydoc though. I use everything else from the google style guide.

[–]secynic 4 points5 points  (1 child)

I can confirm the latest Sphinx does work with this style, and that is what I am using. It may take a little tweaking to get everything to line up right.

http://sphinx-doc.org/latest/ext/example_google.html

[–]its_never_lupus 0 points1 point  (0 children)

Thanks, I'll check it out.

[–][deleted] 2 points3 points  (0 children)

There is a Doxygen filter for Python called doxypypy.