Skip to main content

project-map

Understand what a Python file depends on — without running the code.

project-map 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-map main.py
Project Map

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-map-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 is project-mapper, the CLI command is project-map, and the Python import package is project_map.

Usage

CLI

project-map main.py                      # writes ./project-map-report.html
project-map ./main.py --output map.html  # custom output
project-map main.py -o map.html --open   # open in default browser
project-map main.py --verbose            # extra diagnostics
project-map --help

Python API

from project_map import analyze
from project_map.report import generate_html

result = analyze("main.py")
generate_html(result, "project-map-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-map 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.0.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.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file project_mapper-0.1.0.tar.gz.

File metadata

  • Download URL: project_mapper-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 27509ce9adfb22168b34bdd264f5b59d6d56228199dc868858facf3ab995bcbc
MD5 403d21bc12b9131eca137ed3c2d7f076
BLAKE2b-256 ed2ad6f373a47de732674ad0c00aebf3286ad3d828aa73dd70d5a879469183fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_mapper-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: project_mapper-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e00d410796895ea514c5abfef403d69ccb2fc3a0afe8d9036d50aa8e2d529eb
MD5 84e17259ce7d7ca56f43ef7efe221ea0
BLAKE2b-256 2bc6a39de47193d86906217db1ef533fdafdb5aeea5d2f123caa589eba319db9

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_mapper-0.1.0-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

0.1.1

2 files

This release

0.1.0 This release

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