whoimports tool scans Python codebases to trace all imports of a module
A new open-source command-line tool called whoimports helps Python developers identify every file that imports a given module before renaming, moving, or deleting it. Unlike basic text searches, it uses Python's Abstract Syntax Tree (AST) to accurately detect import statements without triggering false positives from strings or comments. The tool supports both file paths and dotted module names, and can output results in plain text, Markdown, or JSON formats. It requires no external dependencies and works with Python 3.10 and above. Available on GitHub under the MIT license, it is designed to complement other refactoring tools such as gitchurn and redactx.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in