Sortify
Project Description
sortify is a Python package containing implementations of different sorting algorithms. This module is implemented using vanilla Python and does not need any additional dependencies.
Installation
Simply run the following command in the terminal to install sortify:
pip install sortify
Usage
The following example demonstrates how you can use sortify:
from sortify import Sort
if __name__ == "__main__":
arr = [1, 7, 2, 6, 3, 5, 4]
print(Sort.bubble(arr))
This prints the following result:
[1, 2, 3, 4, 5, 6, 7]
The available sorting methods are:
- Sort.bubble(arr: list, reverse: bool) → Bubble sort
- Sort.insertion(arr: list, reverse: bool) → Insertion sort
- Sort.selection(arr: list, reverse: bool) → Selection sort
- Sort.quick(arr: list, reverse: bool) → Quick sort
- Sort.mergesort(arr: list, reverse: bool) → Merge sort
Here, set the parameter reverse = True to sort the list in descending order. For example:
from sortify import Sort
if __name__ == "__main__":
arr = [1, 7, 2, 6, 3, 5, 4]
print(Sort.merge(arr, reverse=False))
This prints the following result:
[7, 6, 5, 4, 3, 2, 1]
Metadata
Release files for sortify 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sortify-1.2.1.tar.gz | 3.0 kB | Without provenance | Details |
Release files / sortify-1.2.1.tar.gz
| Download URL | sortify-1.2.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7680876cb53f362b5aba567976493ad4b76ffb24cc43c920c38bb5fa00181dd1
|
|
BLAKE2b-256 checksum How to use checksums |
d4a0256fea20d0a66d12214eb62e2882d33d0a6ce1cd86e840231ed5a794eafa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for sortify 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.