Review Python methods as code: what comes in, what it calls and changes, what it returns — with tests, callers, and models beside it.
PyPI: threadline-review · VS Code extension · Get started · Documentation · GitHub · Report a bug
Threadline opens your Python repository in a local browser, or writes it to one HTML file. Choose an endpoint, command, or method to read its code under a one-line summary of its inputs, the project functions it calls, what it changes, and what it returns. Called functions, related tests, callers, and model declarations open beside the code; the call map shows everything it reaches.
Mark a method as reviewed once you have read it, follow the Review plan to the code that
matters first, and let threadline coverage or a Git hook check that changed code has been read.
It reads source without importing or running the project being reviewed. That project's dependencies do not need to be installed.
The only file it writes in your project is .threadline/reviews.json, and only when you mark a method.
Requires Python 3.12 or later. In your Python environment:
The PyPI package is threadline-review; the installed command is threadline.
Use --pre for the current beta releases.
python -m pip install --pre threadline-review
threadline review /path/to/your/python-projectYour browser opens the review automatically. If it does not, open the local address printed in the terminal. For virtual-environment setup, see the installation guide.
threadline review /path/to/your/python-project --output review.htmlThis writes a single HTML file, opens it, and exits. It needs no server, internet
connection, or Python installation to view. Search, the call map, method code,
tests, callers, models, and Git comparisons work from the embedded snapshot. Add --base HEAD
to include changes or --no-open to generate the file without opening a browser.
Regenerate the file after editing source; omit --output for a local server with
Refresh source. The HTML contains the reviewed source, including a baseline
when requested. Large exports take longer to prepare and are capped at 256 MiB; use
--source-root or --exclude to narrow them, or use the local server for very
large codebases.
The GitHub Pages prototype accepts a public repository URL,
analyzes its Python source in your browser, and offers an interactive preview and
HTML download. It uses the same analyzer through Pyodide, without a Python server.
See the setup guide
to run it locally or deploy it with the included Pages workflow.
This version supports a single source snapshot, without Git comparisons.
Links such as ?repo=owner/name start a review directly; after a review, copy the
link or a README badge for your repository (details).
Install Threadline — Python Review
from the Visual Studio Marketplace, or run code --install-extension Raman369AI.threadline-review.
The extension preview opens the function at your cursor, workspace methods, or Git
changes in an editor panel. It includes source jumps, stale-source notices, refresh,
and standalone HTML export. It requires VS Code 1.95+ and Python 3.12+. See the
extension guide.
| Part | What it shows |
|---|---|
| Summary | In, Calls, Changes, Effects, Returns, and Raises. Calls includes methods called on objects passed in, such as db.commit or repository.save. Effects shows database, network, file, process, and logging work, split into reads and writes, including what arrives through called project code ("DB write via update_user"). Select an item to highlight it in the code or open the call. Dashed items are uncertain. |
| Code | Only the selected method. Select a name to highlight every use; underlined calls open beside the code. |
| Beside the code | The opened call, test, or caller with its calling line marked, then Tests, Callers, and Models as source. |
| Review record | Under the method name: Not reviewed, Reviewed by NAME on DATE, or Reviewed …, but its code changed since, with Mark reviewed or Undo, what the method writes, how many are left, and Next unreviewed →. Not shown in saved HTML. |
| Call map | Project functions the method reaches, each with the line that calls it and tags such as if, later, or probably. |
Open → moves into a method; Back returns with your highlight and side code intact.
| Control | What it does |
|---|---|
| ☰ (top left) | Hides or shows the sidebar to give the code the full width. |
| Divider between the code and the side pane | Drag to resize, or focus it and use the arrow keys; double-click or Enter resets it. |
| Instructions (bottom right) | How to read the review, keyboard shortcuts, and source Coverage. |
| Theme (top right) | Dark by default; switch to Light, or to System to follow the operating system setting. |
The width and theme are remembered in your browser.
| Page | How to use it |
|---|---|
| Endpoints | Filter by HTTP verb or text, or by router file in the sidebar; routes are grouped by file. Select one to open it. |
| Commands & tasks | Select a CLI command or background task. Test modules you can run with python -m are folded into their own group. |
| Modules & methods | Open folders in the sidebar tree or filter the module cards, open a module, then select one of its methods. |
| Review plan | Each endpoint, command, or task with how much of the code it reaches is reviewed. Functions that write to a database, the network, or files come first. Open an entry to choose a method, or start with the next unreviewed one. |
Search is available across all three pages. Each link points to source evidence. Unresolved sources and effects remain visible as gaps rather than invented values. The usage guide explains model references, navigation, and the limits of static data flow.
Compare a working tree with a Git baseline:
threadline review /path/to/your/python-project --base HEADOpen Changes to select a changed method or compare its before/after source. A changed method's code has the lines that differ from the baseline marked, and the Review plan lists only the changed functions. Changed files, rename-only records, and edits outside methods remain visible when no callable body changes. Current callers, historical callers, and possible impact are shown separately. These are direct source relationships, not a complete impact analysis.
For source roots, exclusions, snapshot-pinned JSON queries, and evidence retrieval, see the usage guide.
Record which functions and methods a person has reviewed, and fail a hook or CI job when too little of the code has been:
threadline coverage /path/to/your/python-project --mark package.module:create_order
threadline coverage /path/to/your/python-project --fail-under 80
threadline coverage /path/to/your/python-project --base origin/main --fail-under 100In the browser review and the VS Code panel, Mark reviewed under a method's name records
it once its code is shown; --mark does the same from the command line. Reviews are kept in
.threadline/reviews.json; commit that file. A saved HTML file cannot record reviews. The review stops counting when the method's code changes, or when what it calls
or affects changes — for example, a function it calls starts writing to the database.
--base counts only functions changed since a Git revision, so an existing repository can
start with new code. A result under --fail-under exits with status 4. A record says who
marked a method and when; it does not show that the code was understood.
The Review plan page says where to start in code nobody has read: each endpoint or command with what it reaches, and the functions that write to a database, the network, or files first. When comparing with a Git revision, a method's changed lines are marked in its code.
threadline hook install adds an opt-in Git hook that holds a push (or, with --on commit,
a commit) until the changed methods are marked: at a terminal it opens the review and
continues once they are; in CI or under a coding agent it lists them and fails. See the
usage guide.
Threadline uses static analysis. A call either resolves to one project function, is
tagged probably (a likely target), is a library call, or is tagged can't tell
(decided at runtime) — supported, possible, external, and unknown in JSON
output. Name highlighting matches names within a method; it is not a runtime value trace. Common injected,
inherited, and constructed receivers can have possible source candidates. Dynamic
dispatch can remain unresolved; the view does not establish what happened at runtime.
The header shows analysis problems, and Instructions → Coverage (bottom-right corner) lists parse failures and unmodeled
syntax.
This is a beta. Linux and macOS are tested with Python 3.12–3.14; Windows is experimental. Human reviewer sessions remain pending before a stable release.
- Capabilities and limits
- Validation and platform coverage
- Keyboard access and accessibility
- Changelog
See the contributor guide for development and testing, and the publishing guide for releases.