https://github.com/cabralpinto/trevis

Python library for visualizing recursive function calls in the console

https://github.com/cabralpinto/trevis

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.3%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Python library for visualizing recursive function calls in the console

Basic Info
  • Host: GitHub
  • Owner: cabralpinto
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 6.84 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

Trevis

Easily visualize recursive functions in the console.

```python from trevis import recursion

@recursion def fib(n: int) -> int: if n < 2: return n return fib(n - 1) + fib(n - 2)

fib(4) python

output

fib(4) → 3 ├╴fib(3) → 2 │ ├╴fib(2) → 1 │ │ ├╴fib(1) → 1 │ │ └╴fib(0) → 0 │ └╴fib(1) → 1 └╴fib(2) → 1 ├╴fib(1) → 1 └╴fib(0) → 0 ```

Features

  • 🕹️ Interactive mode: Review each function execution interactively, advancing to the next step by pressing Enter. This mode enhances comprehension and debugging by providing a clear visual representation of each step. Enable with recursion(interactive=True).
  • 🌈 Syntax highlighting (upcoming): Enable syntax highlighting in the tree for improved readability. Coming in a future version.

Installation

Ensure you have Python 3.6 or higher, then install Trevis using pip:

bash pip install trevis

Contribution

Contributions are welcome! Feel free to submit an issue or pull request.

License

Trevis is licensed under the MIT License.

Owner

  • Name: João Cabral Pinto
  • Login: cabralpinto
  • Kind: user

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Issues and Pull Requests

Last synced: 10 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 14 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: trevis

trevis

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 14 Last month
Rankings
Dependent packages count: 10.7%
Average: 35.6%
Dependent repos count: 60.5%
Maintainers (1)
Last synced: 10 months ago

Dependencies

pyproject.toml pypi