GithubHelp home page GithubHelp logo

theobori / callviz Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 40 KB

๐Ÿ“Š Function calls visualization

Home Page: https://pypi.org/project/callviz/

License: MIT License

Python 89.58% Shell 0.08% Nix 10.34%
calls function graph graphviz python recursion debug

callviz's Introduction

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, 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)), [])

callviz's People

Contributors

theobori avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.