r/learnpython • • Jul 26 '20

Algovis: A python library for learning, visualizing and analysing algorithms

Hi!, I've made Algovis, a python library made for visualizing and analyzing algorithms. As a beginner, I always had trouble visualizing algorithms so I made this very easy to use library to help new python users get started. It has a lot of nice features like printing the code to terminal and visualizing in reverse. Getting started is extremely easy as well, just 5 lines of code

# importing the sorting module

from algovis import sorting

import random

my_list = [i + 1 for i in range(100)]

random.shuffle(my_list)

# creating an oject of the BubbleSort class and passing the list

bs_object = sorting.BubbleSort(my_list)

#calling the visualize method

bs_object.visualize(interval=100)

Currently the library has

Sorting

  • Bubble Sort

  • Insertion Sort

  • Selection Sort

  • Merge Sort

  • Quick Sort

Searching

  • Linear Search

  • Binary Search

Github Repo: https://github.com/hotshot07/algovis

Documentation: https://algovisdocs.netlify.app

PyPI: https://pypi.org/project/algovis/

Happy Coding :)

EDIT: Well this blew up! I'm glad you all liked it and thanks for the award u/Seralyn that made my day! I'm currently messing around with the networkx library, might add some graph algorithms in near future if I get it working.

Some python resources that I really found helpful while learning python were YouTubers Corey Schafer and Dan Bader(his python tricks book is great too). Fluent Python, obviously. For writing good code for this library I used google's style guide which is amazing (https://google.github.io/styleguide/pyguide.html). Just don't read books and follow tutorials try to make something cool and nice you'll learn a lot faster. For 'personal growth' I'd recommend 'Deep Work', by Cal Newport, that is probably the only self-help book you'll ever need for that domain and it works. The best way to learn a language is to take it slow, understand what's happening, think deeply about trivial things and then move forward.

On a side note, I was having a chat with mum who's halfway across the globe atm and she told me that 26th July 2018 was the day I had a terrible accident on the tennis court (broke 3 of my 4 knee ligaments) because of which I had to leave the university tennis team and was bedridden for about 6 months (add depression, anxiety and all that stuff). On 26th July 2020, exactly 2 years after that incident I release a python library that was trending on r/learnpython. If you're struggling, things do get better. It just takes time :)

364 Upvotes

Duplicates