Metadata-Version: 2.4
Name: vizzpy
Version: 0.3.0
Summary: Interactive Python call tree visualizer — upload a project, explore its call graph in the browser
Author: Atul
License-Expression: MIT
Project-URL: Homepage, https://github.com/atulsaurav/vizzpy
Project-URL: Repository, https://github.com/atulsaurav/vizzpy
Project-URL: Bug Tracker, https://github.com/atulsaurav/vizzpy/issues
Keywords: python,call-tree,call-graph,ast,visualization,static-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100
Requires-Dist: uvicorn[standard]>=0.23
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: graphviz>=0.20
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: anyio[trio]; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Dynamic: license-file

# VizzPy

Interactive Python call tree visualizer. Upload a Python project and explore its function call graph in the browser.

## Features

- **Interactive web UI** — zoom, pan, drag nodes, collapse subtrees
- **Cross-module resolution** — follows imports across files to draw edges between modules
- **Dark mode** — toggle with one click
- **Headless mode** — render a static SVG or Mermaid flowchart from the command line (SVG requires Graphviz)
- **Folder or zip upload** — drag-and-drop a `.zip` or browse for a local folder

## Installation

```bash
pip install vizzpy
```

Headless SVG rendering additionally requires the [Graphviz](https://graphviz.org/download/) system package:

```bash
# macOS
brew install graphviz

# Debian/Ubuntu
apt install graphviz
```

Mermaid output has no extra dependencies.

## Usage

### Web UI (recommended)

```bash
vizzpy --serve
# open http://127.0.0.1:8000
```

Upload a `.zip` of your Python project or select a local folder, then click **Analyze**.

- **Scroll / pinch** to zoom
- **Drag background** to pan
- **Drag nodes** to rearrange
- **Double-click a node** to collapse/expand its call subtree
- **Hover** a node to see its docstring

### Headless rendering

```bash
# SVG (default) — requires Graphviz
vizzpy --headless ./myproject
vizzpy --headless ./myproject --output call_tree.svg

# Mermaid markdown — no extra dependencies
vizzpy --headless ./myproject --format mermaid
vizzpy --headless ./myproject --format mermaid --output call_tree.md
```

### Options

```
vizzpy --serve   [--host HOST] [--port PORT]
vizzpy --headless PROJECT_PATH [--format svg|mermaid] [--output OUTPUT]
```

## How it works

VizPy uses Python's `ast` module to do a two-pass analysis of your source files:

1. **Scope pass** — collects every top-level function and class method with its qualified name (`module.ClassName.method`)
2. **Edge pass** — walks each file again, resolves `self.method()`, `cls.method()`, imported names, and direct calls to project-internal functions

Results are rendered in the browser with [dagre-d3](https://github.com/dagrejs/dagre-d3) (vendored, works offline). Calls to stdlib or third-party libraries are silently excluded.

## Development

```bash
git clone https://github.com/atulsaurav/vizzpy
cd vizzpy
pip install -e ".[dev]"

# run tests
pytest

# run with coverage
pytest --cov=vizzpy --cov-report=term-missing
```

## License

MIT
