semvec/pypi-packages huggingface dataset:
sort-visualizer 1.0.6
Python package to visualize any sorting algorithm
License: MIT
Keywords: SORT,SORTING,VISUALIZATION,VISUALIZE

# Sort_visualizer
[![Downloads](https://pepy.tech/badge/sort-visualizer)](https://pepy.tech/project/sort-visualizer)

Sort_visualizer is a tool that will allow you to easily visualize any sorting algorithms

## Install

    pip install sort-visualizer

## Usage

### Short guide

 1. Install package
 2. Create `.py` and import package with `from sort_visualizer import gui, algs`
 3. Create your own sort (Or use ones you need from [algs.py](https://github.com/DirectDuck/sort_visualizer/blob/master/sort_visualizer/algs.py))
 4. Initialize gui object with `gui.GUI()` 
 5. Add sorting algorithms to gui via `test_gui.add_sort(NAME, SORT_CLASS)`
 > To add from `algs.py` simply use `test_gui.add_sort('Bubble', algs.BubbleSort)`, for example
6. Run gui with `test_gui.run()`

### How to write your own sort

In order to visualize your own sort you need to create a class that inherits from **algs.Sort** and implement **execute(self)** method.

To access array use **self.array**.

Every object in **self.array** is a **Rectangle** class instance. To access associated value use **.height** attribute.

Visual functions:
 - When an element changed its value use **self.redraw()** 
 - When swapping two elements of the array use **self.swap_rects(rect1: Rectangle, rect2: Rectangle)**

(Please note that **swap_rects** function only applies visual part, you still need to *actually swap the values in array*)

In [test.py](https://github.com/DirectDuck/sort_visualizer/blob/master/test.py) you can find example of creating your own algorithm and actually run python test.py` to see how it works.

To see more examples check [sort_visualizer/algs.py](https://github.com/DirectDuck/sort_visualizer/blob/master/sort_visualizer/algs.py)
pyconduit 1.0.4
A simple workflow manager that can execute developer-defined methods from user-defined workflow files.
License: MIT
Requires Python: >=3.7

<p align="center">
<img src="https://pyconduit.ysfchn.com/images/main.png" width="800">
</p>

# pyconduit

A simple workflow manager that executes pre-defined functions from user-defined workflow files. You ("developer") create the functions, and they ("users") will able to call the functions by typing its name and pass the required parameters.

It can be used to provide a "custom code evaluation" / "safe eval" feature to your users in your app. So they will only able to access functions that you allow. Users can also reference to other steps, set variables, and use standard functions in their workflow files.

pyconduit comes with Text, Math, Dictionary, List and Variable blocks like in Python's standard built-in functions. So you don't need to reinvent the wheel by writing these functions again.

It **does not** execute multiple functions in the same time. It executes functions _step by step_ (because that's a how "workflow" works), so next function will only execute **after** previous function has finished execution. Even if they are asynchronous / coroutines.

## Features

* Prevent access to a block for specific user. For example, if you have a block that makes a HTTP request, you can add a label to it, and pyconduit will not allow your users to use the function if job doesn't have that label too.

* Add step limits, max usage limit for a block per workflow (it can be changed for a specific job too).

* If you install [`pydantic` library](https://github.com/samuelcolvin/pydantic/) in your environment, pyconduit will use it automatically to enforce type hints / annotations in function parameters, so users won't able to send invalid type of values when parameter expects a specific type of value.

* Use [Context Tags](https://pyconduit.ysfchn.com/context_values) in the workflows to access variables, get the return value of previous steps and read object values with dotted path. For example, users can type `{: my_step_id :}` in the workflow to get the return value of `my_step_id` dynamically.

## Warning

As pyconduit can be used as "isolated space", you should be careful about functions that you enabled to user. (for example, you shouldn't make a function that allows users to get a global value in the runtime from their input). Also, even pyconduit blocks access to keys that starts or ends with underscore, there is no 100% warranty about security.

## Install

```
python -m pip install pyconduit
```

## Links

* [Quick Start](https://pyconduit.ysfchn.com/quick_start)
* [Documentation](https://pyconduit.ysfchn.com/)

## License

Source code is licensed under MIT license. You must include the license notice in all copies or substantial uses of the work.