A collection of classic and practical sorting algorithms
Project description
SortCraft is a comprehensive Python package providing an extensive collection of sorting algorithms suitable for educational, research, and benchmarking purposes. All implementations are type-annotated, documented for clarity, and exposed through a clean flat API for easy import and exploration.
Features
- More than twenty sorting algorithms, including classical, integer/distribution, advanced, parallel, and theoretical types.
- All functions have PEP 484 type annotations and rich, standardized docstrings suitable for IDE/hover documentation and Sphinx autodoc.
- Simple import model:
from sortcraft import merge_sort, quick_sort, cycle_sort, .... - Designed for reliability, readability, and educational use cases as well as algorithmic experimentation.
Installation
Install the latest release from PyPI:
pip install sortcraft
Quick Usage
from sortcraft import merge_sort, heap_sort
data = [5, 2, 9, 1]
sorted_data = merge_sort(data) # [1, 2, 5, 9]
Included Algorithms
- Classical comparison sorts: bubble_sort, selection_sort, insertion_sort, merge_sort, quick_sort, heap_sort
- Counting/distribution sorts: counting_sort, radix_sort, pigeonhole_sort, flash_sort, bucket_sort
- Advanced or hybrid: shell_sort, comb_sort, cocktail_sort, timsort, bitonic_sort, cycle_sort
- Educational or theoretical: pancake_sort, gnome_sort, stooge_sort, bogo_sort, odd_even_sort
All functions require a sequence of comparable elements and return a new sorted list.
Type Annotations and Docstring Standards
- All user-facing APIs are type-annotated (PEP 484/561 compliant via the included py.typed marker).
- Docstrings follow the Google style, suitable for Sphinx autodoc and IDE hover documentation.
- Each algorithm documents its stability, complexity, and typical usage.
Version Logs
1.0.0: Added support for singly, doubly and circular linked lists0.1.7: Added error handling in every algorithms0.1.5: Added badges in README.md0.1.4: Modified logo for the package0.1.3: Added 22 different types of sorting algorithms
License
SortCraft is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions by way of issue reports, algorithm additions, or improvements to documentation are welcome. Please open an issue or submit a pull request on GitHub.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sortcraft-1.0.0.tar.gz.
File metadata
- Download URL: sortcraft-1.0.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a1f69d39c809cd8ab36b96b99b2b40415210cdd964b02a8f7dabcb43de89a3e
|
|
| MD5 |
fce068cfb8ef9e5932ee3d2476bb26de
|
|
| BLAKE2b-256 |
4bd1dea5c08d06f9327ea5ac724ff5a7e3c5590b1e10824d1f039a87bcce2d91
|
File details
Details for the file sortcraft-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sortcraft-1.0.0-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
622163377d2e8c42fc14b6f003d43f0685f33d5823cc07bae3a5796b286e629e
|
|
| MD5 |
12438f7bcd3bd67998e97610ff14054f
|
|
| BLAKE2b-256 |
7a65357467eef3e855399d957a4cd610c1bbcafbd3ed6b79c1bbc4d65278abf1
|