========================================
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`.
Raw data
{
"_id": null,
"home_page": "https://github.com/abuawaish/awaish_pkg",
"name": "pattern-sort-package",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "funny",
"author": "Abu Awaish",
"author_email": "abuawaish7@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3a/ba/11dab3325de550559914fd971f7f4a073f425442dc16f8c86cd85f37f4c4/pattern_sort_package-1.0.3.tar.gz",
"platform": null,
"description": "========================================\r\nPattern and Sort Package\r\n========================================\r\n\r\nBadges\r\n------\r\n\r\n.. image:: https://badge.fury.io/py/pattern-sort-package.svg\r\n :target: https://pypi.org/project/pattern-sort-package/\r\n\r\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\r\n :target: https://opensource.org/licenses/MIT\r\n\r\nA Python package providing utilities for creating various patterns and performing sorting algorithms.\r\n\r\nThis package is designed to assist developers in generating different types of patterns for visualization and performing efficient sorting operations on datasets.\r\n\r\nFeatures\r\n--------\r\n\r\n- **Pattern Generation**:\r\n - Triangle patterns (normal, reverse, hollow, and more).\r\n - Square patterns (normal, hollow, and checkerboard).\r\n - Pyramid and diamond patterns.\r\n - Custom pattern options.\r\n\r\n- **Sorting Algorithms**:\r\n - Bubble Sort\r\n - Merge Sort\r\n - Quick Sort\r\n - Selection Sort\r\n - Insertion Sort\r\n - Heap Sort\r\n - Shell Sort\r\n - Counting Sort\r\n - Radix Sort\r\n - Bucket Sort\r\n\r\nInstallation\r\n------------\r\n\r\nInstall the package using pip:\r\n\r\n.. code-block:: bash\r\n\r\n pip install pattern-sort-package\r\n\r\nUsage\r\n-----\r\n\r\n1. **Import the package**:\r\n Import the `Pattern` and `Sort` classes from the package.\r\n\r\n .. code-block:: python\r\n\r\n from pattern_sort import Pattern, Sort\r\n\r\n2. **Pattern Examples**:\r\n\r\n Generate a triangle pattern:\r\n\r\n .. code-block:: python\r\n\r\n pattern = Pattern()\r\n pattern.print_triangle(5)\r\n\r\n # Output:\r\n # *\r\n # **\r\n # ***\r\n # ****\r\n # *****\r\n\r\n Generate a pyramid pattern:\r\n\r\n .. code-block:: python\r\n\r\n pattern.print_pyramid(5)\r\n\r\n # Output:\r\n # *\r\n # ***\r\n # *****\r\n # *******\r\n # *********\r\n\r\n3. **Sorting Examples**:\r\n\r\n Sort a list using Bubble Sort:\r\n\r\n .. code-block:: python\r\n\r\n sort = Sort()\r\n sorted_list = sort.bubble_sort([3, 2, 1])\r\n print(sorted_list)\r\n\r\n # Output:\r\n # [1, 2, 3]\r\n\r\n Sort a list using Merge Sort:\r\n\r\n .. code-block:: python\r\n\r\n sorted_list = sort.merge_sort([5, 3, 8, 6, 2])\r\n print(sorted_list)\r\n\r\n # Output:\r\n # [2, 3, 5, 6, 8]\r\n\r\n\r\nDocumentation\r\n-------------\r\n\r\nThe `Pattern` and `Sort` classes contain the following methods:\r\n\r\n1. **Pattern Class**:\r\n\r\n - `print_triangle(rows)`: Prints a triangle pattern with the given number of rows.\r\n - `print_reverse_triangle(rows)`: Prints a reverse triangle pattern.\r\n - `print_pyramid(rows)`: Prints a pyramid pattern.\r\n - `print_diamond(rows)`: Prints a diamond pattern.\r\n - `print_square(size)`: Prints a square pattern.\r\n - `print_hollow_square(size)`: Prints a hollow square pattern.\r\n - `print_right_triangle(rows)`: Prints a right-aligned triangle pattern.\r\n - `print_hollow_triangle(rows)`: Prints a hollow triangle pattern.\r\n - `print_checkerboard(rows, cols)`: Prints a checkerboard pattern.\r\n - `print_zigzag(rows, cols)`: Prints a zigzag pattern.\r\n\r\n2. **Sort Class**:\r\n\r\n - `bubble_sort(arr)`: Sorts a list using the Bubble Sort algorithm.\r\n - `selection_sort(arr)`: Sorts a list using the Selection Sort algorithm.\r\n - `insertion_sort(arr)`: Sorts a list using the Insertion Sort algorithm.\r\n - `merge_sort(arr)`: Sorts a list using the Merge Sort algorithm.\r\n - `quick_sort(arr)`: Sorts a list using the Quick Sort algorithm.\r\n - `heap_sort(arr)`: Sorts a list using the Heap Sort algorithm.\r\n - `shell_sort(arr)`: Sorts a list using the Shell Sort algorithm.\r\n - `counting_sort(arr)`: Sorts a list using the Counting Sort algorithm.\r\n - `radix_sort(arr)`: Sorts a list using the Radix Sort algorithm.\r\n - `bucket_sort(arr)`: Sorts a list using the Bucket Sort algorithm.\r\n\r\nTesting\r\n-------\r\n\r\nThe package includes unit tests to validate its functionality. You can run the tests using the following command:\r\n\r\n.. code-block:: bash\r\n\r\n python -m unittest discover tests\r\n\r\nLicense\r\n-------\r\n\r\nThis project is licensed under the MIT License. See the LICENSE file for details.\r\n\r\nContact\r\n-------\r\n\r\n- **Author**: Abu Awaish\r\n- **Email**: abuawaish7@gmail.com\r\n- **GitHub**: https://github.com/abuawaish/awaish_pkg\r\n\r\n\r\nChangelog\r\n=========\r\n\r\nAll notable changes to this project will be documented in this file.\r\n\r\nVersion 1.0.3 (2024-12-26)\r\n--------------------------\r\n- `Added`: Initial release of the package.\r\n- `Added`: `Pattern` class with 10 pattern-generation methods:\r\n - `print_triangle`, `print_reverse_triangle`, `print_pyramid`, `print_diamond`, etc.\r\n- `Added`: `Sort` class with 10 sorting algorithms:\r\n - `bubble_sort`, `merge_sort`, `quick_sort`, `selection_sort`, etc.\r\n- `Added`: Unit tests for all pattern and sorting methods.\r\n- `Added`: Comprehensive documentation in `README.rst`.\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python package for pattern generation and sorting algorithms.",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://github.com/abuawaish/awaish_pkg"
},
"split_keywords": [
"funny"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "306b7b78dcda1332114efd6c5adb7d4afabf2d6ce712a14fa4a16364e18dfc44",
"md5": "651414cde349170d8c4596a5b8eb0f1c",
"sha256": "ee67904c20990b25d19ee1d584775b368fbd63b4530e9eef39d5fc231343fcc9"
},
"downloads": -1,
"filename": "pattern_sort_package-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "651414cde349170d8c4596a5b8eb0f1c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5441,
"upload_time": "2024-12-26T05:52:20",
"upload_time_iso_8601": "2024-12-26T05:52:20.418451Z",
"url": "https://files.pythonhosted.org/packages/30/6b/7b78dcda1332114efd6c5adb7d4afabf2d6ce712a14fa4a16364e18dfc44/pattern_sort_package-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3aba11dab3325de550559914fd971f7f4a073f425442dc16f8c86cd85f37f4c4",
"md5": "c9a692178b4b4aef852122df7d470973",
"sha256": "3465e8be7c68c7e6438d8b2eaa361784febc6b25596de0a42ed39a6aa9bceb24"
},
"downloads": -1,
"filename": "pattern_sort_package-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "c9a692178b4b4aef852122df7d470973",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6114,
"upload_time": "2024-12-26T05:52:23",
"upload_time_iso_8601": "2024-12-26T05:52:23.103168Z",
"url": "https://files.pythonhosted.org/packages/3a/ba/11dab3325de550559914fd971f7f4a073f425442dc16f8c86cd85f37f4c4/pattern_sort_package-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-26 05:52:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "abuawaish",
"github_project": "awaish_pkg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pattern-sort-package"
}