Analyze and predict impacted Python modules from code changes using static dependency analysis.
Project description
Code Change Impact Analyzer
A Python package and CLI that predicts which Python modules are impacted when a file changes.
What it does
Given a changed file (for example auth/login.py), the analyzer:
- Parses project files.
- Detects function definitions.
- Builds import and call dependency graphs.
- Maps function usage across modules.
- Shows impacted modules.
Why engineers use it
- Understand blast radius before merging changes.
- Speed up code reviews in large codebases.
- Decide where to add or run tests.
Installation
pip install code-change-impact-analyzer
For local development:
pip install -e .[dev]
CLI Usage
impact-analyzer --root . --changed auth/login.py
Options:
--root: project root directory to analyze (default: current directory)--changed: changed file path relative to root (required)--json: print JSON output
Example Output
Editing: auth/login.py
Impacted modules:
- api/routes.py
- user/service.py
- tests/test_login.py
How it works
The tool performs static analysis over Python source files:
- Collects module imports (
import x,from x import y) - Collects function definitions per module
- Collects function calls per module
- Builds reverse dependency graph to find modules depending on the changed module
- Expands impact by function-level usage signals
Limitations
- Dynamic imports and metaprogramming are not fully resolved.
- Runtime dispatch and monkey patching are not modeled.
- Best for conventional Python codebases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_change_impact_analyzer-0.1.0.tar.gz.
File metadata
- Download URL: code_change_impact_analyzer-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0671cbbdeb33bdb8487492ed5aa803cef25797d6ebba58c818521ec12f052b4b
|
|
| MD5 |
8a66f562fa3dc5277d0a145910046510
|
|
| BLAKE2b-256 |
3db07824b70fa12113ec613f841dbba1f42e0ff69686eb410125228a79d1ddcb
|
File details
Details for the file code_change_impact_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: code_change_impact_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e07ea821dffdc709f0f52cf9c38a3d1c9eae93e4d84762593ad567e5eaabbd95
|
|
| MD5 |
a074cacac2f37fa9084c2eaf8bfd464a
|
|
| BLAKE2b-256 |
42704d2b0d0ec38df66fd5a47dc109ba8613ab6abe91fce63c0185209566d7d0
|