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

19 comments sorted by

24

u/o-rka Jul 26 '20

Love it. Also your website is extremely clean. Made me want to try and get my documentation down.

5

u/[deleted] Jul 26 '20

Thank you! I just updated it with small 'Examples'. I've used mkdocs with the material theme, easy to set up and work with.

7

u/Tal_Av Jul 26 '20

This is super cool man! Nice easy API, definitely going to give it a try.

3

u/[deleted] Jul 26 '20

Yeah that was my idea, to make it easy to use. Glad you liked it :D

4

u/itsmegeorge Jul 26 '20

This is amazing

2

u/[deleted] Jul 26 '20

Thank you :D

4

u/Seralyn Jul 27 '20

As a beginning python learner and as a human, I think you're awesome.

2

u/[deleted] Jul 27 '20

You’re very kind, thank you :)

2

u/[deleted] Jul 27 '20

LEGEND.

1

u/[deleted] Jul 27 '20

Thank you ahaha

2

u/pmrks Jul 27 '20

Noice!

2

u/[deleted] Jul 27 '20

isn't it?! ahaha thank you :)

2

u/Quinhos Jul 27 '20

Looks neat! Thanks bro

1

u/[deleted] Jul 27 '20

Thanks man!

2

u/KingBonnn Jul 27 '20

We need more people like you in this sub. Keep it up!

1

u/[deleted] Jul 27 '20

Thanks!

2

u/[deleted] Jul 27 '20

Nice

0

u/[deleted] Jul 27 '20

[deleted]

2

u/[deleted] Jul 27 '20

Thanks :D