# SpAlgo

<p align='center'>
    <a href="#">
        <img src="https://raw.githubusercontent.com/Amir-Shamsi/SpAlgo/master/spalgo.png"  alt="spalgo" />
    </a>
</p>


[![Python version](https://img.shields.io/badge/python-%5E3.*-purple?style=flat-square)](https://www.python.org/)
[![BSD Licence](https://img.shields.io/badge/licence-MIT-geen?style=flat-square)](LICENSE)
<a href="https://github.com/Amir-Shamsi/SpAlgo" title="Repo Size">
<img src="https://img.shields.io/github/repo-size/Amir-Shamsi/SpAlgo?label=Repo%20Size&logo=Github&style=flat-square" alt="Project Initiator Repo Size"/>
</a>
[![Downloads](https://static.pepy.tech/personalized-badge/spalgo?period=total&units=international_system&left_color=black&right_color=MediumVioletRed&left_text=Downloads)](https://pepy.tech/project/spalgo)
[![PyPI version shields.io](https://img.shields.io/pypi/v/SpAlgo.svg?style=flat-square)](https://pypi.python.org/pypi/SpAlgo/)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/amir-shamsi/spalgo/CodeQL?style=flat-square)

[![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://github.com/Amir-Shamsi/SpAlgo/blob/master/CONTRIBUTING.md)

SpAlgo is a python library with special algorithms which can help you in your education or any other purpose.

## Overview
SpAlgo is a python library with special algorithms which can help you in your education or any other purpose.
By now, this library contains some algorithms for the following items and other algorithms will be added soon.
  - Sequence
  - Array
  - Matrix
  - Knapsack

life is so short so you don't need to spend your time implementing these algorithms so we recommend you use SpAlgo if you want to have a faster experience.


## Usage

In the following paragraphs, I am going to describe how you can get and use Scrapeasy for your own projects.

###  Getting it

To download SpAlgo, either fork this github repo or simply use Pypi via pip.
```sh
$ pip install SpAlgo
```

### Using it

SpAlgo was programmed with ease-of-use in mind. First, import Matrix, Array and Subsequence from SpAlgo

for more exact usage documents you can see the example files [here](https://github.com/Amir-Shamsi/SpAlgo/blob/master/src/examples)

```Python
from SpAlgo import Matrix, Array, MaxSubseq, Knapsack
```

then you can them bassed on what you need.

for `array` the current available methods are:
```python
findPeak()
findAllPeak()
findFisrtPeak()
findMaxPeak()
findMaxPeak()
```

for `matrix` the current available methods are:
```python
findPeak()
findAllPeak()
```

for `sequence` the current available methods are:
```python
maximmum_sum()
subsequence()
```

for `knapsack` the current available methods are:
```python
getPack()
getTotalValue()
getUsedWeight()
getWastedWeight()
getCrumbledItem()
```

## Support 
Supported versions of python for this library are as follow:
* [Python v3](https://www.python.org/downloads/release/python-300/)
* [Python v3.4](https://www.python.org/downloads/release/python-340/)
* [Python v3.5](https://www.python.org/downloads/release/python-350/)
* [Python v3.6](https://www.python.org/downloads/release/python-360/)
* [Python v3.7](https://www.python.org/downloads/release/python-370/)
* [Python v3.8](https://www.python.org/downloads/release/python-380/)
* [Python v3.9](https://www.python.org/downloads/release/python-390/)
* [Python v3.10](https://www.python.org/downloads/release/python-3100/)

## License
Read license 
[here](https://github.com/Amir-Shamsi/SpAlgo/blob/master/LICENSE):
```
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

