Old Python projects rot in a quiet way. Functions get new parameters and the docstring above them stays frozen. I've been building a command-line tool, Legacy Doc-AI, that finds those gaps and drafts fixes. To see if the problem is real, I pointed its scanner at four well-known libraries.
What the scan found
Functions with no docstring at all:
- marshmallow: 177 of 236 (75%)
- flask: 596 of 856 (70%)
- requests: 392 of 635 (62%)
- urllib3: 1293 of 1634 (79%)
These are raw counts. The scanner counts every function and method it finds, including private helpers and tests, and many of those are fine without docs. So read them as "how much is uncovered", not "how badly these projects are run".
What the tool does
- It reads your code and lists every function and class.
- It flags the ones with no docstring, or whose documented parameters differ from the real ones.
- It sends each function and its surrounding code to an AI model, which drafts a docstring.
- It shows you the changes, and nothing is written until you accept them.
Where it's at
It's early. I'm not claiming it writes perfect docs, and I haven't measured how accurate the drafts are. I want honest feedback from people who maintain older Python code.
There's a free audit: send me a public repo and I'll send back the coverage report. Sign-up is at https://legacy-doc-ai.pages.dev.
The planned price is £39 per repo per month. Does that sound sensible? And what would make you trust generated docstrings in your repo?
Top comments (0)