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.7: 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.7.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.7-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortcraft-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 aafb7ce6a3837c941cff394b18f9ef5b6a14e5aa6f32eb9647584dd01243a1f7
MD5 c95fa68f8a726fa06bbbb5071e748765
BLAKE2b-256 d14020a47b209b22aa951da702039668fe28189604af1db95e9eb757ebf12074

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortcraft-0.1.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fd595b585ce006d86b78bec92df33432d3ae720cab2310f4a9d8af9354bea7dc
MD5 2750e16985b0225a85563a249f7f8fcf
BLAKE2b-256 c47605c8aad917e4ace60a547e23ac9446245cfd803b720e48e1a80f1d2f5e17

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