Skip to main content

A collection of classic and practical sorting algorithms

Project description

sortcraft logo

PyPI - Version PyPI - Downloads 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

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:

  • 0.1.3: Added 22 different types of sorting algorithms
  • 0.1.4: Modified logo for the package
  • 0.1.5: Added badges in README.md
  • 0.1.6: Added error handling in every 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

sortcraft-0.1.6.tar.gz (11.4 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.6-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortcraft-0.1.6.tar.gz
  • Upload date:
  • Size: 11.4 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.6.tar.gz
Algorithm Hash digest
SHA256 c295ff5377f5f696b7ae80a193cabec12104860e7e0751116074c605fda6fce4
MD5 302ef391d32c7385055af0307560f427
BLAKE2b-256 e8992d4e02946cf76a6436979870dd4c367717f2b2848c9e36468768b2f51204

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortcraft-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 24.3 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 26be1dcc87c5b47be8acc5a7d68a66fbca9983b9ba217ffeae1022fe40afa981
MD5 d94088c835b7c90618ba46a71b5ce202
BLAKE2b-256 edb2074865783e81f926b40169749ee4c719aa74df4484299779e7e701a9db7f

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