Python

Python Docstring Extractor

Pulls out every docstring in a module and shows which definitions are missing one.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the module, or load a .py file with the picker.
  2. Turn on "show only what is missing" to use it as an audit rather than as a reading list.
  3. Skip private names if a percentage dragged down by small helpers is not useful to you.
  4. Select Extract the docstrings, then copy the table or download it as CSV.

What python docstring extractor does

Two jobs, one page. The first is documentation: pull every docstring out of a module and read them together, which is a much better way to judge whether the descriptions still match the code than scrolling past the bodies. The second is the audit: see at a glance which functions and classes have nothing at all.

Finding a docstring properly means understanding Python's strings rather than pattern-matching quotes. A docstring can use triple or single quotes, can carry an r or u prefix, can contain quotes of the other kind, and a definition can span several lines before its body starts. All of that is handled by a scanner that reads the source the way the interpreter does. Private names — a leading underscore, but not dunders — can be skipped, because a four-line private helper is rarely where a missing docstring matters, and counting it drags the percentage down for no reason.

Frequently asked questions

The first string literal in a module, class or function body, which is what Python itself treats as the docstring. Anything between the definition and that string — a comment, a statement — means the string is not a docstring, and the page agrees with the interpreter on that. Triple quotes, single quotes and r or u prefixes are all recognised.

Because a coverage figure dragged down by four-line private helpers is not telling you anything you can act on. A leading single underscore is the convention for "not part of the public interface", and those are often small enough that the code is the documentation. Dunder methods are not skipped, since __init__ frequently deserves a docstring more than anything else in the class.

Only one module at a time. The page takes text or a single file, so a package means running it per module — which is often the right pace anyway, since documenting is done file by file. The CSV download makes it straightforward to combine the results afterwards if you want one list.