Skip to main content

A collection of classic and practical sorting algorithms

Project description

sortcraft logo

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

Or, for the latest development version:

pip install git+https://github.com/arijitkroy/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.

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

sortcraft-0.1.4.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

sortcraft-0.1.4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file sortcraft-0.1.4.tar.gz.

File metadata

  • Download URL: sortcraft-0.1.4.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for sortcraft-0.1.4.tar.gz
Algorithm Hash digest
SHA256 80d317ce617531df56451ed17a25c08ffa6edd04e529b243030fc649762bd705
MD5 1b7b569c2c319043c31b9a7b42902307
BLAKE2b-256 8273e159041e5065540725a45e8770bb81ef08fee37f4050787104b67e143553

See more details on using hashes here.

File details

Details for the file sortcraft-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: sortcraft-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for sortcraft-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eac6d7cdd40ea3146ff2f588fa74ec3361b476ec37003b4d2cd4d339e006c7cb
MD5 0490ddab972973ea23205dd75737b0d2
BLAKE2b-256 1f5ee1d41d77f7e8b9a68218681c0183cb2fed9a2ca1fb62d47fe31a1886491e

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