Skip to main content

A collection of classic and practical sorting algorithms

Project description

sortcraft logo

PyPI - version PyPI - License

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.5.tar.gz (9.8 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.5-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortcraft-0.1.5.tar.gz
  • Upload date:
  • Size: 9.8 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.5.tar.gz
Algorithm Hash digest
SHA256 803cb45e5345bf2cf05ec2b5cccbb55b67c2a69b9b4af19ee7b33e856a93e7f2
MD5 b4a4b4c1592d6e26a40b5e3b0840e695
BLAKE2b-256 062125b3dcb9347838e953047565180ad58983381cb13e9cd4e83121012fc4df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortcraft-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 18.6 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 21c4c6100d743eba05f35defebd196bd5a08722dc55ed455c590d2c2b425e7f0
MD5 6d84c74f91f46164e9309146237ece05
BLAKE2b-256 cd8ea22911e2a89572147083758b3d587d44681c91602b892fdce6e7b5449c6f

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