project-mapper
Understand what a Python file depends on — without running the code.
project-mapper is a static analysis tool for Python. Point it at an entry-point
file and it maps every local file that entry point reaches, classifies its
imports, detects environment-variable names, and produces a polished,
self-contained HTML report.
It never executes the code it analyzes. It makes no network calls. It sends no telemetry. Everything runs locally.
project-mapper main.py
Project Mapper
Analyzing
/Users/yash/projects/example/main.py
Scanning dependencies...
✓ Entry point parsed
✓ 8 Python files analyzed
✓ 13 local dependencies found
✓ 5 third-party imports found
✓ 11 standard-library imports found
✓ 4 environment variables found
Generating HTML report...
✓ Report generated
./project-mapper-report.html
How it works
Entry point
↓
AST analysis (Python's ast module — never executed)
↓
Local dependency resolution
↓
Recursive traversal
↓
HTML report
Installation
pip install project-mapper
Or from source:
git clone https://github.com/Yashjindal11/projectmap
cd projectmap
pip install -e ".[dev]"
Requires Python 3.10+.
Naming: the PyPI distribution and CLI command are both
project-mapper, and the Python import package isproject_map.
Usage
CLI
project-mapper main.py # writes ./project-mapper-report.html
project-mapper ./main.py --output map.html # custom output
project-mapper main.py -o map.html --open # open in default browser
project-mapper main.py --verbose # extra diagnostics
project-mapper --help
Python API
from project_map import analyze
from project_map.report import generate_html
result = analyze("main.py")
generate_html(result, "project-mapper-report.html")
print(result.third_party_imports) # ['pandas', 'requests']
print(result.environment_variables) # ['API_KEY', 'DATABASE_URL']
Example
Given:
my-project/
├── main.py
├── config.py
├── services/
│ └── customer.py
└── utils/
└── helpers.py
project-mapper main.py
The report shows the dependency structure:
main.py
├── config.py
└── services/customer.py
└── utils/helpers.py
plus:
Third Party
requests
Standard Library
os
logging
Environment Variables
API_KEY
Features
- Static Python analysis — parses the AST; never runs your code.
- Recursive local dependency mapping — follows reachable local imports.
- Import classification — local, standard library, third-party, unresolved.
- Environment-variable detection — reports names only, never values.
- Standalone HTML report — inline CSS/SVG, works offline via
file://. - CLI and Python API.
- No code execution. No network. No telemetry.
Privacy & safety
- The analyzed code is treated as untrusted input and is never imported,
executed, or evaluated (no
eval, noexec, no subprocesses). .envfiles are never read. Only environment-variable names that appear literally in the source are reported — never their values.- No network requests are made by the analyzer.
Limitations
Static analysis cannot perfectly resolve every import. In particular:
- Dynamic imports such as
importlib.import_module(name)or__import__(name)cannot be followed. - Third-party import names are not guaranteed PyPI package names — for example,
import cv2corresponds to the PyPI packageopencv-python. They are labelled as third-party imports, not package names. - V1 targets common, predictable project layouts. Exotic import machinery, namespace packages, and sys.path manipulation may not resolve.
Where resolution is uncertain, the import is reported honestly as Unresolved rather than guessed.
License
MIT — see LICENSE.
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 project_mapper-0.1.1.tar.gz.
File metadata
- Download URL: project_mapper-0.1.1.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5a101f04e337d0a4cdeae358d4803a423189b8733fe485fbb4ac1314814a8a
|
|
| MD5 |
c81f556fbba4a58bce6aa9cf01b4b4c1
|
|
| BLAKE2b-256 |
19874a9476e55ff1db7d8527e656028de82316371d0e7cd8d54fc3f96dfd1452
|
Provenance
The following attestation bundles were made for project_mapper-0.1.1.tar.gz:
Publisher:
release.yml on Yashjindal11/projectmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
project_mapper-0.1.1.tar.gz -
Subject digest:
9c5a101f04e337d0a4cdeae358d4803a423189b8733fe485fbb4ac1314814a8a - Sigstore transparency entry: 2614936582
- Sigstore integration time:
-
Permalink:
Yashjindal11/projectmap@f59ebdb801966942d38fd32d60550c2c6b63d0bd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yashjindal11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f59ebdb801966942d38fd32d60550c2c6b63d0bd -
Trigger Event:
release
-
Statement type:
File details
Details for the file project_mapper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: project_mapper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a20f0f0a833298393f5ff69f81909d4f1f1e816fd204b8f9d5681bbb1821ba5
|
|
| MD5 |
0a234e9fc0753e91abeec414fae0ee86
|
|
| BLAKE2b-256 |
7ee5d811de8f295c6d68743fff44f550f3ffa4236d18eca6bba988073c888330
|
Provenance
The following attestation bundles were made for project_mapper-0.1.1-py3-none-any.whl:
Publisher:
release.yml on Yashjindal11/projectmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
project_mapper-0.1.1-py3-none-any.whl -
Subject digest:
3a20f0f0a833298393f5ff69f81909d4f1f1e816fd204b8f9d5681bbb1821ba5 - Sigstore transparency entry: 2614936894
- Sigstore integration time:
-
Permalink:
Yashjindal11/projectmap@f59ebdb801966942d38fd32d60550c2c6b63d0bd -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yashjindal11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f59ebdb801966942d38fd32d60550c2c6b63d0bd -
Trigger Event:
release
-
Statement type: