Skip to main content

Visualsort lets you write sorting algorithms with given functions and then render them to videos.

Project description

visualsort

See your sorting code in motion:
Write and see you sorts with visualsort

visualsort is released under the MIT license. Follow @tomasbivainis

Visualsort provides functions with which you can program a sorting algortithm and then render the sorting algorithm.

Instalation

To install the package only for use, run

pip install visualsort

in the terminal.

Quick start

Here is an example of rendering a bubble sort:

from visualsort import swap, render, compare

def bubble_sort(nums):
  for i in range(len(nums)):
    for j in range(i + 1, len(nums)):
      if compare(i, j, nums):
        nums = swap(i, j, nums)

render(bubble_sort)

Development

To set up a local development environment, run:

git clone git@github.com:TomasBivainis/visualsort.git
cd visualsort
pip insatll -r requirements.txt

Tests

Tests can be found in the tests folder. To run them, run:

pytest

in the main directory.

Documentation

Documentation for the library functions can be found here.

If you have added functions to the library, you can generate an updated version of the documentation with pdoc by typing the following command in the main directory:

pdoc visualsort --no-search --output-dir docs

This will automatically generate updated documentation in HTML format in the docs folder.

For it to be able to automatically generate the documentation you will need to use the same code documentation format as the previous functions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Issues

For issues, please open a GitHub issue.

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

visualsort-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visualsort-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file visualsort-0.1.0.tar.gz.

File metadata

  • Download URL: visualsort-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for visualsort-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2a37092223ae9eeb7c28762bed23a261bc960a8e1e6a1e5e354f81bff898f3b
MD5 6ea2fe895a93f46df95d8d0d03ecf7e6
BLAKE2b-256 d86b7cf1c7f4514bb40e405c2e0c096bc701a7b9f81ebc694729732ee57520c0

See more details on using hashes here.

File details

Details for the file visualsort-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: visualsort-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.1

File hashes

Hashes for visualsort-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b34e0f2185cc517fea8bfcbe6ee5173b6155b28f55215e02a5cb69c771dce89c
MD5 61b511a4aa612a2416c1cc79615d9af3
BLAKE2b-256 8b053405baaf61b5e27070a96282473273709d4fd491d80b69a22894446f4eb2

See more details on using hashes here.

Supported by

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