pattern-sort-package 1.0.3
A Python package for pattern generation and sorting algorithms.
License: MIT
Requires Python: >=3.6
Keywords: funny

========================================
Pattern and Sort Package
========================================

Badges
------

.. image:: https://badge.fury.io/py/pattern-sort-package.svg
    :target: https://pypi.org/project/pattern-sort-package/

.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
    :target: https://opensource.org/licenses/MIT

A Python package providing utilities for creating various patterns and performing sorting algorithms.

This package is designed to assist developers in generating different types of patterns for visualization and performing efficient sorting operations on datasets.

Features
--------

- **Pattern Generation**:
  - Triangle patterns (normal, reverse, hollow, and more).
  - Square patterns (normal, hollow, and checkerboard).
  - Pyramid and diamond patterns.
  - Custom pattern options.

- **Sorting Algorithms**:
  - Bubble Sort
  - Merge Sort
  - Quick Sort
  - Selection Sort
  - Insertion Sort
  - Heap Sort
  - Shell Sort
  - Counting Sort
  - Radix Sort
  - Bucket Sort

Installation
------------

Install the package using pip:

.. code-block:: bash

   pip install pattern-sort-package

Usage
-----

1. **Import the package**:
   Import the `Pattern` and `Sort` classes from the package.

   .. code-block:: python

      from pattern_sort import Pattern, Sort

2. **Pattern Examples**:

   Generate a triangle pattern:

   .. code-block:: python

      pattern = Pattern()
      pattern.print_triangle(5)

      # Output:
      # *
      # **
      # ***
      # ****
      # *****

   Generate a pyramid pattern:

   .. code-block:: python

      pattern.print_pyramid(5)

      # Output:
      #     *
      #    ***
      #   *****
      #  *******
      # *********

3. **Sorting Examples**:

   Sort a list using Bubble Sort:

   .. code-block:: python

      sort = Sort()
      sorted_list = sort.bubble_sort([3, 2, 1])
      print(sorted_list)

      # Output:
      # [1, 2, 3]

   Sort a list using Merge Sort:

   .. code-block:: python

      sorted_list = sort.merge_sort([5, 3, 8, 6, 2])
      print(sorted_list)

      # Output:
      # [2, 3, 5, 6, 8]


Documentation
-------------

The `Pattern` and `Sort` classes contain the following methods:

1. **Pattern Class**:

   - `print_triangle(rows)`: Prints a triangle pattern with the given number of rows.
   - `print_reverse_triangle(rows)`: Prints a reverse triangle pattern.
   - `print_pyramid(rows)`: Prints a pyramid pattern.
   - `print_diamond(rows)`: Prints a diamond pattern.
   - `print_square(size)`: Prints a square pattern.
   - `print_hollow_square(size)`: Prints a hollow square pattern.
   - `print_right_triangle(rows)`: Prints a right-aligned triangle pattern.
   - `print_hollow_triangle(rows)`: Prints a hollow triangle pattern.
   - `print_checkerboard(rows, cols)`: Prints a checkerboard pattern.
   - `print_zigzag(rows, cols)`: Prints a zigzag pattern.

2. **Sort Class**:

   - `bubble_sort(arr)`: Sorts a list using the Bubble Sort algorithm.
   - `selection_sort(arr)`: Sorts a list using the Selection Sort algorithm.
   - `insertion_sort(arr)`: Sorts a list using the Insertion Sort algorithm.
   - `merge_sort(arr)`: Sorts a list using the Merge Sort algorithm.
   - `quick_sort(arr)`: Sorts a list using the Quick Sort algorithm.
   - `heap_sort(arr)`: Sorts a list using the Heap Sort algorithm.
   - `shell_sort(arr)`: Sorts a list using the Shell Sort algorithm.
   - `counting_sort(arr)`: Sorts a list using the Counting Sort algorithm.
   - `radix_sort(arr)`: Sorts a list using the Radix Sort algorithm.
   - `bucket_sort(arr)`: Sorts a list using the Bucket Sort algorithm.

Testing
-------

The package includes unit tests to validate its functionality. You can run the tests using the following command:

.. code-block:: bash

   python -m unittest discover tests

License
-------

This project is licensed under the MIT License. See the LICENSE file for details.

Contact
-------

- **Author**: Abu Awaish
- **Email**: abuawaish7@gmail.com
- **GitHub**: https://github.com/abuawaish/awaish_pkg


Changelog
=========

All notable changes to this project will be documented in this file.

Version 1.0.3 (2024-12-26)
--------------------------
- `Added`: Initial release of the package.
- `Added`: `Pattern` class with 10 pattern-generation methods:
    - `print_triangle`, `print_reverse_triangle`, `print_pyramid`, `print_diamond`, etc.
- `Added`: `Sort` class with 10 sorting algorithms:
    - `bubble_sort`, `merge_sort`, `quick_sort`, `selection_sort`, etc.
- `Added`: Unit tests for all pattern and sorting methods.
- `Added`: Comprehensive documentation in `README.rst`.