Metadata-Version: 2.1
Name: callviz
Version: 0.2.0
Summary: Recursive function calls visualization using Graphviz
Home-page: https://github.com/theobori/callviz
Author: Théo Bori
Author-email: nagi@tilde.team
License: MIT License
        
        Copyright (c) 2024 Théo Bori
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: graphviz

# Function call visualization

[![lint](https://github.com/theobori/callviz/actions/workflows/lint.yml/badge.svg)](https://github.com/theobori/callviz/actions/workflows/lint.yml) [![build](https://github.com/theobori/callviz/actions/workflows/build.yml/badge.svg)](https://github.com/theobori/callviz/actions/workflows/build.yml) [![publish](https://github.com/theobori/callviz/actions/workflows/publish.yml/badge.svg)](https://github.com/theobori/callviz/actions/workflows/publish.yml)

It is a Python decorator that will help you visualizate the function calls, in particular for the recursive ones. Under the hood [Graphviz](https://graphviz.org/) is used to generate the graph.

## 📖 Build and run

For the build, you only need the following requirements:

- [Python](https://www.python.org/downloads/) 3+ (tested with 3.12.4)

To install it from [PyPi](https://pypi.org), you can run the following command:

```bash
python -m pip install callviz
```

## 🤝 Contribute

If you want to help the project, you can follow the guidelines in [CONTRIBUTING.md](./CONTRIBUTING.md).

## 📎 Some examples

Here is an example of how you could use the decorator.

```py
from callviz import callviz

@callviz(_format="png", memoization=True, open_file=True)
def fib(n: int):
    if n < 2:
        return n

    return fib(n - 2) + fib(n - 1)

@callviz(show_link_value=False)
def rev(arr, new):
    if arr == []:
        return new

    return rev(arr[1:], [arr[0]] + new)

fib(7)
rev(list(range(6, 0, -1)), [])
```
