Skip to main content

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 is project_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, no exec, no subprocesses).
  • .env files 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 cv2 corresponds to the PyPI package opencv-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

project_mapper-0.1.1.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

project_mapper-0.1.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

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

Hashes for project_mapper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c5a101f04e337d0a4cdeae358d4803a423189b8733fe485fbb4ac1314814a8a
MD5 c81f556fbba4a58bce6aa9cf01b4b4c1
BLAKE2b-256 19874a9476e55ff1db7d8527e656028de82316371d0e7cd8d54fc3f96dfd1452

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_mapper-0.1.1.tar.gz:

Publisher: release.yml on Yashjindal11/projectmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for project_mapper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a20f0f0a833298393f5ff69f81909d4f1f1e816fd204b8f9d5681bbb1821ba5
MD5 0a234e9fc0753e91abeec414fae0ee86
BLAKE2b-256 7ee5d811de8f295c6d68743fff44f550f3ffa4236d18eca6bba988073c888330

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_mapper-0.1.1-py3-none-any.whl:

Publisher: release.yml on Yashjindal11/projectmap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page