Metadata-Version: 2.4
Name: dependaman
Version: 2.0.0
Summary: Understand your Python project's internal structure. Find cycles, dead code, and coupling hotspots — visualized as an interactive HTML graph.
Author-email: Jacobo Bedoya <jacobobedoya@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://dependaman.jacobobedoya.com/en/
Project-URL: Repository, https://codeberg.org/jacobitosuperstar/DependaMan
Project-URL: Changelog, https://dependaman.jacobobedoya.com/en/changelog/
Project-URL: Design, https://dependaman.jacobobedoya.com/en/design/
Project-URL: Constraints, https://dependaman.jacobobedoya.com/en/constraints/
Keywords: dependency,analysis,visualization,graph,dead-code,architecture,ast
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# DependaMan

Understand your Python project's internal structure. Find cycles, dead modules,
hotspots, and architecture problems — visualized as an interactive graph.

---

## Installation

```bash
pip install dependaman
```

## Usage

**CLI:**

```bash
dependaman                          # autodetect the project root, open the graph
dependaman /path/to/project         # analyze another project
dependaman --format json -o -       # print the analysis as JSON on stdout
dependaman -o graph.html            # choose the output file
dependaman --no-docs                # drop docstrings and source
dependaman --no-git                 # skip the git pass, most of the runtime
dependaman --no-browser             # write the file, do not open a browser
dependaman --help
```

Point `dependaman` at the directory that _contains_ your top-level package, not
at the package itself — imports are resolved against the package name, so
analyzing `myproject/myproject/` leaves most modules without edges.

| Flag                         | Meaning                                            |
| ---------------------------- | -------------------------------------------------- |
| `path`                       | project root (optional, autodetected from the cwd) |
| `-f`, `--format {html,json}` | output format (default: `html`)                    |
| `-o`, `--output-path PATH`   | destination file, or `-` for stdout                |
| `--no-docs`                  | docstrings and source come back null, spans stay   |
| `--no-git`                   | skip the git history pass, most of the runtime     |
| `--no-browser`               | do not open the rendered HTML                      |
| `--version`                  | print the installed version                        |

JSON output is the whole analysis, so it pipes:

```bash
dependaman --format json -o - | jq '.cycles'
```

**Python API:**

```python
from dependaman import dependaman

if __name__ == "__main__":
    dependaman()                                    # writes Dependaman.html, opens browser
    dependaman("/path/to/project", in_memory=True)  # returns the HTML as a string
    dependaman(".", output_format="json", output_path="graph.json")  # json at output_path
```

Without the guard, a project big enough to reach the process pool (100 files and
up) re-imports your script in every child, breaks the pool, and degrades to one
process with a warning.

Every argument after `path` is keyword-only:

| Argument        | Default  | Meaning                                            |
| --------------- | -------- | -------------------------------------------------- |
| `path`          | `"."`    | project root to analyze                            |
| `docs`          | `True`   | docstrings, and each module's source               |
| `git`           | `True`   | each module's commit churn                         |
| `output_format` | `"html"` | `"html"` or `"json"`                               |
| `in_memory`     | `False`  | return the rendered text instead of writing a file |
| `output_path`   | `None`   | destination; derived from the format when omitted  |
| `open_browser`  | `True`   | open the written file                              |

With `in_memory=True` nothing is written and `output_path` / `open_browser` are
ignored — useful for serving the graph from a web handler.

---

## Documentation

- [Website](https://dependaman.jacobobedoya.com/en/)
- [Design](https://dependaman.jacobobedoya.com/en/design/)
- [Constraints](https://dependaman.jacobobedoya.com/en/constraints/)
- [Changelog](https://dependaman.jacobobedoya.com/en/changelog/)
- [Repository](https://codeberg.org/jacobitosuperstar/DependaMan)
