python-Pantry


Namepython-Pantry JSON
Version 3.0.2 PyPI version JSON
download
home_pagehttps://github.com/sattyamjjain/pyPantry
SummaryPython Package for Data structure and algorithms implementation with its proper explanation
upload_time2024-05-25 17:48:38
maintainerNone
docs_urlNone
authorSattyam Jain
requires_python>=3.9
licenseNone
keywords pydsa pypantry dsa data structure algo algorithm ds python data structure
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# pyPantry: Your One-Stop Solution for  DSA, Design Patterns and etc. in Python

`pyPantry` is a comprehensive Python library offering robust implementations of numerous data structures and algorithms. It serves as a reliable tool for educators, students, developers, and anyone keen on mastering or utilizing these foundational computer science concepts.

## ๐Ÿ“‹ Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
  - [Data Structures](#data-structures)
  - [Algorithms](#algorithms)
  - [Design Patterns](#design-patterns)
- [Testing](#testing)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
- [Contact](#contact)

## ๐ŸŒŸ Features

### Data Structures

- **Graph**: Traverse complex networks. 
  - `PyGraph.py`
  - `PyLinkedGraph.py`
  
- **Heap**: Efficient data management.
  - `PyMaxHeap.py`
  - `PyMinHeap.py`
  
- **LinkedList**: Flexible data storage.
  - `PyCircularLinkedList.py`
  - `PyDoublyCircularLinkedList.py`
  - `PyDoublyLinkedList.py`
  - `PyHeaderLinkedList.py`
  - `PyLinkedList.py`
  - `PySkipLinkedList.py`
  
- **Queue**: FIFO data handling.
  - `PyCircularQueue.py`
  - `PyDeque.py`
  - `PyPriorityQueue.py`
  - `PyQueue.py`
  
- **Stack**: LIFO data access.
  - `PyStack.py`
  - `pyLinkedStack.py`
  
- **Tree**: Hierarchical data modeling.
  - `PyAVLTree.py`
  - `PyBTree.py`
  - `PyBinarySearchTree.py`
  - `PyBinaryTree.py`
  - `PyGenericTree.py`
  
- **Trie**: Rapid text retrieval.
  - `PyTrie.py`

### Algorithms

#### Searching

- **Binary Search**: `PyBinarySearch.py`
- **Jump Search**: `PyJumpSearch.py`
- **Linear Search**: `PyLinearSearch.py`
- **Fibonacci Search**: `PyFibonacciSearch.py`
- **Exponential Search**: `PyExponentialSearch.py`
- **Ternary Search**: `PyTernarySearch.py`
- **Meta Binary Search**: `PyMetaBinarySearch.py`
- **Sentinel Linear Search**: `PySentinelLinearSearch.py`
- **Interpolation Search**: `PyInterpolationSearch.py`

#### Sorting

- **BogoSort**: `PyBogoSort.py`
- **Odd-Even Sort**: `PyOddEvenSort.py`
- **Sleep Sort**: `PySleepSort.py`
- **Cocktail Sort**: `PyCocktailSort.py`
- **Radix Sort**: `PyRadixSort.py`
- **Bubble Sort**: `PyBubbleSort.py`
- **Selection Sort**: `PySelectionSort.py`
- **Bingo Sort**: `PyBingoSort.py`
- **QuickSort**: `PyQuickSort.py`
- **Counting Sort**: `PyCountingSort.py`
- **Bucket Sort**: `PyBucketSort.py`
- **Gnome Sort**: `PyGnomeSort.py`
- **HeapSort**: `PyHeapSort.py`
- **Bitonic Sort**: `PyBitonicSort.py`
- **Strand Sort**: `PyStrandSort.py`
- **Shell Sort**: `PyShellSort.py`
- **TimSort**: `PyTimSort.py`
- **Pancake Sort**: `PyPancakeSort.py`

### Design Patterns

#### Architectural Patterns

- **Event-Driven Architecture**: `PyEventDrivenArchitecturePattern.py`
- **Microservices**: `PyMicroservicesPattern.py`
- **Model-View-Controller (MVC)**: `PyModelViewControllerPattern.py`
- **Model-View-ViewModel (MVVM)**: `PyModelViewViewModelPattern.py`
- **Service-Oriented Architecture (SOA)**: `PyServiceOrientedArchitecturePattern.py`

#### Behavioral Patterns

- **Chain of Responsibility**: `PyChainOfResponsibilityPattern.py`
- **Command**: `PyCommandPattern.py`
- **Interpreter**: `PyInterpreterPattern.py`
- **Iterator**: `PyIteratorPattern.py`
- **Mediator**: `PyMediatorPattern.py`
- **Memento**: `PyMementoPattern.py`
- **Null Object**: `PyNullObjectPattern.py`
- **Observer**: `PyObserverPattern.py`
- **Specification**: `PySpecificationPattern.py`
- **State**: `PyStatePattern.py`
- **Strategy**: `PyStrategyPattern.py`
- **Template**: `PyTemplatePattern.py`
- **Visitor**: `PyVisitorPattern.py`

#### Concurrency Patterns

- **Active Object**: `PyActiveObjectPattern.py`
- **Half-Sync/Half-Async**: `PyHalfSyncOrHalfAsyncPattern.py`
- **Leader-Follower**: `PyLeaderOrFollowerPattern.py`
- **Reactor**: `PyReactorPattern.py`
- **Thread Pool**: `PyThreadPoolPattern.py`

#### Creational Patterns

- **Abstract Factory**: `PyAbstractFactoryPattern.py`
- **Builder**: `PyBuilderPattern.py`
- **Factory Method**: `PyFactoryPattern.py`
- **Object Pool**: `PyObjectPoolPattern.py`
- **Prototype**: `PyPrototypePattern.py`
- **Singleton**: `PySingletonPattern.py`

#### Structural Patterns

- **Adapter**: `PyAdapterPattern.py`
- **Bridge**: `PyBridgePattern.py`
- **Composite**: `PyCompositePattern.py`
- **Decorator**: `PyDecoratorPattern.py`
- **Facade**: `PyFacadePattern.py`
- **Flyweight**: `PyFlyweightPattern.py`
- **Private Class Data**: `PyPrivateClassDataPattern.py`
- **Proxy**: `PyProxyPattern.py`

## ๐Ÿ”ง Installation

```bash
pip install python-Pantry 
```

## ๐Ÿš€ Usage

### Data Structures

```python
from pyPantry.DS.Stack.PyStack import PyStack

# Create a new stack
stack = PyStack()

# Push elements onto the stack
stack.push(1)
stack.push(2)
stack.push(3)

# Pop an element from the stack
print(stack.pop())  # Output: 3
```

### Algorithms

```python
from pyPantry.Algo.Sorting.PyBubbleSort import PyBubbleSort

# Sample list to be sorted
sample_list = [64, 34, 25, 12, 22, 11, 90]

# Apply bubble sort
sorted_list = PyBubbleSort(arr=sample_list).sort()
print(sorted_list)  # Output: [11, 12, 22, 25, 34, 64, 90]
```

### Design Patterns

#### Strategy Pattern

```python
from pyPantry.DesignPatterns.Behavioral.Strategy.PyStrategyPattern import PyStrategyPattern

class CreditCardPayment(PyStrategyPattern.PaymentStrategy):
    def pay(self, amount):
        return f"Paid {amount} using Credit Card"

payment_method = CreditCardPayment()
print(payment_method.pay(100))  # Output: Paid 100 using Credit Card
```

## ๐Ÿงช Testing

All implementations come with corresponding test files located in the `tests` directory, ensuring reliability and correctness.

To run tests, use:
```bash
python -m unittest discover tests
```

## ๐Ÿค Contributing

We welcome and value contributions from the open-source community. Your input, whether it's a bug fix, feature addition, or documentation improvement, helps enhance `pyPantry`.

1. Fork the repository.
2. Create a new branch.
3. Make your changes.
4. Submit a pull request.

## ๐Ÿ‘ Credits

Crafted with โค๏ธ by [Sattyam Jain](https://www.linkedin.com/in/sattyamjain/).

## ๐Ÿ“œ License

Licensed under the [MIT License](LICENSE).

## ๐Ÿ“ž Contact

For feedback or queries, [contact us](https://www.linkedin.com/in/sattyamjain/). We're always eager to connect!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sattyamjjain/pyPantry",
    "name": "python-Pantry",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "pydsa, pyPantry, dsa, data structure, algo, algorithm, ds, python data structure",
    "author": "Sattyam Jain",
    "author_email": "sattyamjain96@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/04/b0/c080aba8e185a9d8ff77b2f0df8013056ec1da74436e20ce55964bbd1430/python_pantry-3.0.2.tar.gz",
    "platform": null,
    "description": "\n# pyPantry: Your One-Stop Solution for  DSA, Design Patterns and etc. in Python\n\n`pyPantry` is a comprehensive Python library offering robust implementations of numerous data structures and algorithms. It serves as a reliable tool for educators, students, developers, and anyone keen on mastering or utilizing these foundational computer science concepts.\n\n## \ud83d\udccb Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Data Structures](#data-structures)\n  - [Algorithms](#algorithms)\n  - [Design Patterns](#design-patterns)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n- [Contact](#contact)\n\n## \ud83c\udf1f Features\n\n### Data Structures\n\n- **Graph**: Traverse complex networks. \n  - `PyGraph.py`\n  - `PyLinkedGraph.py`\n  \n- **Heap**: Efficient data management.\n  - `PyMaxHeap.py`\n  - `PyMinHeap.py`\n  \n- **LinkedList**: Flexible data storage.\n  - `PyCircularLinkedList.py`\n  - `PyDoublyCircularLinkedList.py`\n  - `PyDoublyLinkedList.py`\n  - `PyHeaderLinkedList.py`\n  - `PyLinkedList.py`\n  - `PySkipLinkedList.py`\n  \n- **Queue**: FIFO data handling.\n  - `PyCircularQueue.py`\n  - `PyDeque.py`\n  - `PyPriorityQueue.py`\n  - `PyQueue.py`\n  \n- **Stack**: LIFO data access.\n  - `PyStack.py`\n  - `pyLinkedStack.py`\n  \n- **Tree**: Hierarchical data modeling.\n  - `PyAVLTree.py`\n  - `PyBTree.py`\n  - `PyBinarySearchTree.py`\n  - `PyBinaryTree.py`\n  - `PyGenericTree.py`\n  \n- **Trie**: Rapid text retrieval.\n  - `PyTrie.py`\n\n### Algorithms\n\n#### Searching\n\n- **Binary Search**: `PyBinarySearch.py`\n- **Jump Search**: `PyJumpSearch.py`\n- **Linear Search**: `PyLinearSearch.py`\n- **Fibonacci Search**: `PyFibonacciSearch.py`\n- **Exponential Search**: `PyExponentialSearch.py`\n- **Ternary Search**: `PyTernarySearch.py`\n- **Meta Binary Search**: `PyMetaBinarySearch.py`\n- **Sentinel Linear Search**: `PySentinelLinearSearch.py`\n- **Interpolation Search**: `PyInterpolationSearch.py`\n\n#### Sorting\n\n- **BogoSort**: `PyBogoSort.py`\n- **Odd-Even Sort**: `PyOddEvenSort.py`\n- **Sleep Sort**: `PySleepSort.py`\n- **Cocktail Sort**: `PyCocktailSort.py`\n- **Radix Sort**: `PyRadixSort.py`\n- **Bubble Sort**: `PyBubbleSort.py`\n- **Selection Sort**: `PySelectionSort.py`\n- **Bingo Sort**: `PyBingoSort.py`\n- **QuickSort**: `PyQuickSort.py`\n- **Counting Sort**: `PyCountingSort.py`\n- **Bucket Sort**: `PyBucketSort.py`\n- **Gnome Sort**: `PyGnomeSort.py`\n- **HeapSort**: `PyHeapSort.py`\n- **Bitonic Sort**: `PyBitonicSort.py`\n- **Strand Sort**: `PyStrandSort.py`\n- **Shell Sort**: `PyShellSort.py`\n- **TimSort**: `PyTimSort.py`\n- **Pancake Sort**: `PyPancakeSort.py`\n\n### Design Patterns\n\n#### Architectural Patterns\n\n- **Event-Driven Architecture**: `PyEventDrivenArchitecturePattern.py`\n- **Microservices**: `PyMicroservicesPattern.py`\n- **Model-View-Controller (MVC)**: `PyModelViewControllerPattern.py`\n- **Model-View-ViewModel (MVVM)**: `PyModelViewViewModelPattern.py`\n- **Service-Oriented Architecture (SOA)**: `PyServiceOrientedArchitecturePattern.py`\n\n#### Behavioral Patterns\n\n- **Chain of Responsibility**: `PyChainOfResponsibilityPattern.py`\n- **Command**: `PyCommandPattern.py`\n- **Interpreter**: `PyInterpreterPattern.py`\n- **Iterator**: `PyIteratorPattern.py`\n- **Mediator**: `PyMediatorPattern.py`\n- **Memento**: `PyMementoPattern.py`\n- **Null Object**: `PyNullObjectPattern.py`\n- **Observer**: `PyObserverPattern.py`\n- **Specification**: `PySpecificationPattern.py`\n- **State**: `PyStatePattern.py`\n- **Strategy**: `PyStrategyPattern.py`\n- **Template**: `PyTemplatePattern.py`\n- **Visitor**: `PyVisitorPattern.py`\n\n#### Concurrency Patterns\n\n- **Active Object**: `PyActiveObjectPattern.py`\n- **Half-Sync/Half-Async**: `PyHalfSyncOrHalfAsyncPattern.py`\n- **Leader-Follower**: `PyLeaderOrFollowerPattern.py`\n- **Reactor**: `PyReactorPattern.py`\n- **Thread Pool**: `PyThreadPoolPattern.py`\n\n#### Creational Patterns\n\n- **Abstract Factory**: `PyAbstractFactoryPattern.py`\n- **Builder**: `PyBuilderPattern.py`\n- **Factory Method**: `PyFactoryPattern.py`\n- **Object Pool**: `PyObjectPoolPattern.py`\n- **Prototype**: `PyPrototypePattern.py`\n- **Singleton**: `PySingletonPattern.py`\n\n#### Structural Patterns\n\n- **Adapter**: `PyAdapterPattern.py`\n- **Bridge**: `PyBridgePattern.py`\n- **Composite**: `PyCompositePattern.py`\n- **Decorator**: `PyDecoratorPattern.py`\n- **Facade**: `PyFacadePattern.py`\n- **Flyweight**: `PyFlyweightPattern.py`\n- **Private Class Data**: `PyPrivateClassDataPattern.py`\n- **Proxy**: `PyProxyPattern.py`\n\n## \ud83d\udd27 Installation\n\n```bash\npip install python-Pantry \n```\n\n## \ud83d\ude80 Usage\n\n### Data Structures\n\n```python\nfrom pyPantry.DS.Stack.PyStack import PyStack\n\n# Create a new stack\nstack = PyStack()\n\n# Push elements onto the stack\nstack.push(1)\nstack.push(2)\nstack.push(3)\n\n# Pop an element from the stack\nprint(stack.pop())  # Output: 3\n```\n\n### Algorithms\n\n```python\nfrom pyPantry.Algo.Sorting.PyBubbleSort import PyBubbleSort\n\n# Sample list to be sorted\nsample_list = [64, 34, 25, 12, 22, 11, 90]\n\n# Apply bubble sort\nsorted_list = PyBubbleSort(arr=sample_list).sort()\nprint(sorted_list)  # Output: [11, 12, 22, 25, 34, 64, 90]\n```\n\n### Design Patterns\n\n#### Strategy Pattern\n\n```python\nfrom pyPantry.DesignPatterns.Behavioral.Strategy.PyStrategyPattern import PyStrategyPattern\n\nclass CreditCardPayment(PyStrategyPattern.PaymentStrategy):\n    def pay(self, amount):\n        return f\"Paid {amount} using Credit Card\"\n\npayment_method = CreditCardPayment()\nprint(payment_method.pay(100))  # Output: Paid 100 using Credit Card\n```\n\n## \ud83e\uddea Testing\n\nAll implementations come with corresponding test files located in the `tests` directory, ensuring reliability and correctness.\n\nTo run tests, use:\n```bash\npython -m unittest discover tests\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome and value contributions from the open-source community. Your input, whether it's a bug fix, feature addition, or documentation improvement, helps enhance `pyPantry`.\n\n1. Fork the repository.\n2. Create a new branch.\n3. Make your changes.\n4. Submit a pull request.\n\n## \ud83d\udc4f Credits\n\nCrafted with \u2764\ufe0f by [Sattyam Jain](https://www.linkedin.com/in/sattyamjain/).\n\n## \ud83d\udcdc License\n\nLicensed under the [MIT License](LICENSE).\n\n## \ud83d\udcde Contact\n\nFor feedback or queries, [contact us](https://www.linkedin.com/in/sattyamjain/). We're always eager to connect!\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python Package for Data structure and algorithms implementation with its proper explanation",
    "version": "3.0.2",
    "project_urls": {
        "Bug Reports": "https://github.com/sattyamjjain/pyPantry",
        "Homepage": "https://github.com/sattyamjjain/pyPantry",
        "Source": "https://github.com/sattyamjjain/pyPantry"
    },
    "split_keywords": [
        "pydsa",
        " pypantry",
        " dsa",
        " data structure",
        " algo",
        " algorithm",
        " ds",
        " python data structure"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5c23cc1443e175359e7e045ceff44db07ab13bcfa1d8f227f13a0c61fb7582d",
                "md5": "1d70ba984a57d35b8582b4794c03aaf2",
                "sha256": "d45b4e522fa7b4965dbb992b45a5dad5159dfd3151a85b440139b8d6c0bc8dba"
            },
            "downloads": -1,
            "filename": "python_Pantry-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d70ba984a57d35b8582b4794c03aaf2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 126015,
            "upload_time": "2024-05-25T17:48:36",
            "upload_time_iso_8601": "2024-05-25T17:48:36.455528Z",
            "url": "https://files.pythonhosted.org/packages/d5/c2/3cc1443e175359e7e045ceff44db07ab13bcfa1d8f227f13a0c61fb7582d/python_Pantry-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04b0c080aba8e185a9d8ff77b2f0df8013056ec1da74436e20ce55964bbd1430",
                "md5": "50e14aca3d12834e69d7e8eaada1ea0a",
                "sha256": "c9f8eb4637f73d9d52800169c1bdbaeafbcad4fec70f6b5bad8e93db447943eb"
            },
            "downloads": -1,
            "filename": "python_pantry-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "50e14aca3d12834e69d7e8eaada1ea0a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 54249,
            "upload_time": "2024-05-25T17:48:38",
            "upload_time_iso_8601": "2024-05-25T17:48:38.202200Z",
            "url": "https://files.pythonhosted.org/packages/04/b0/c080aba8e185a9d8ff77b2f0df8013056ec1da74436e20ce55964bbd1430/python_pantry-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-25 17:48:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sattyamjjain",
    "github_project": "pyPantry",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "python-pantry"
}
        
Elapsed time: 2.30507s