Skip to main content

Recursive function calls visualization using Graphviz

Project description

Function call visualization

lint build publish

It is a Python decorator that will help you visualizate the function calls, in particular for the recursive ones. Under the hood Graphviz is used to generate the graph.

📖 Build and run

For the build, you only need the following requirements:

  • Python 3+ (tested with 3.12.4)

To install it from PyPi, you can run the following command:

python -m pip install callviz

🤝 Contribute

If you want to help the project, you can follow the guidelines in CONTRIBUTING.md.

📎 Some examples

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

from callviz import callviz

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

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

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

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

callviz-0.1.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

callviz-0.1.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page