Metadata-Version: 2.4
Name: pyalltools
Version: 3.3.0
Summary: Library containing various tools that are required by programmers frequently
Home-page: https://techinfoak.wixsite.com/tech-info
Author: Anupam Kanoongo
Author-email: programmer.tiak@gmail.com
License: MIT
Project-URL: Our Website, https://techinfoak.wixsite.com/tech-info
Project-URL: Our YT Handle, https://youtube.com/@techinfoak
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# pyalltools

[![PyPI version](https://img.shields.io/pypi/v/pyalltools.svg)](https://pypi.org/project/pyalltools/)
[![Python](https://img.shields.io/pypi/pyversions/pyalltools.svg)](https://pypi.org/project/pyalltools/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A collection of everyday Python utilities — integer math, string analysis,
data-structure helpers, and more — packaged for easy reuse.

---

## Installation

```bash
pip install pyalltools
```

---

## Quick Start

```python
from pyalltools import Int, Str, List, MyTuple, Stack, Queue, binary_search
```

---

## Classes & Usage

### `Int(number)`

Integer utilities.

```python
from pyalltools import Int

n = Int(17)
print(n.is_prime())       # True
print(n.factorial())      # 355687428096000  (17!)
print(Int(121).is_palindrome())  # True

print(Int.find_primes(1, 50))   # [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
print(Int.reverse(1234))        # 4321
print(Int.sum_digits(1234))     # 10
```

| Method | Description |
|---|---|
| `is_prime()` | Returns `True` if the number is prime (O(√n)) |
| `factorial()` | Returns n! (`None` for negatives) |
| `is_palindrome()` | Returns `True` if digits read the same forwards and backwards |
| `find_primes(start, stop)` | Returns list of primes in `[start, stop]` |
| `reverse(number)` | Returns the digit-reversed integer |
| `sum_digits(number)` | Returns the sum of all digits |

---

### `Str(string)`

String analysis and manipulation.

```python
from pyalltools import Str

s = Str("Hello World 123")
print(s.analyze())
# {'Total': 15, 'UpperCase': 2, 'LowerCase': 8, 'Digits': 3, 'Alphabets': 10, 'Others': 2}

print(Str("racecar").is_palindrome())   # True
print(s.occurrence("l"))               # 3
print(Str.longest_word("the quick brown fox"))  # 'quick'
```

| Method | Description |
|---|---|
| `is_palindrome()` | Returns `True` if the string is a palindrome |
| `analyze()` | Returns character breakdown (totals, upper/lower/digit/other) |
| `occurrence(word)` | Counts non-overlapping occurrences of `word` |
| `longest_word(string)` | Returns the longest whitespace-separated word |

---

### `List(lst)`

List utilities.

```python
from pyalltools import List

l = List([3, 1, 4, 1, 5, 9, 2, 6, 5])
print(l.frequency())        # {3: '1 time', 1: '2 times', 4: '1 time', ...}
print(l.maxminrange(0, 4))  # {'Max': 5, 'Min': 1}
print(l.removedups())       # [3, 1, 4, 5, 9, 2, 6]  (order preserved)
```

| Method | Description |
|---|---|
| `frequency()` | Returns element → frequency string dict |
| `maxminrange(start, stop)` | Max/min of slice `[start, stop]` (both inclusive) |
| `removedups()` | New list with duplicates removed (insertion order preserved) |

---

### `MyTuple(my_tuple)`

Tuple utilities — mirrors `List` for immutable sequences.

```python
from pyalltools import MyTuple

t = MyTuple((1, 2, 2, 3, 3, 3))
print(t.frequency())   # {1: '1 time', 2: '2 times', 3: '3 times'}
print(t.removedups())  # (1, 2, 3)
```

---

### `Stack()`

A LIFO stack.

```python
from pyalltools import Stack

s = Stack()
s.push(10)
s.push(20)
print(s.peek())    # 20
print(s.pop())     # 20
print(s.size())    # 1
print(s.display()) # [10]
```

---

### `Queue()`

A FIFO queue.

```python
from pyalltools import Queue

q = Queue()
q.enqueue("a")
q.enqueue("b")
print(q.peek())     # 'a'
print(q.dequeue())  # 'a'
print(q.size())     # 1
print(q.display())  # ['b']
```

---

### `binary_search(item, array)`

Binary search on any list (array is sorted in-place before searching).

```python
from pyalltools import binary_search

idx = binary_search(7, [3, 1, 4, 1, 5, 9, 2, 6, 7])
print(idx)  # index of 7 in the sorted array, or None if not found
```

---

### `Kali.GetTools()`

Clone a curated collection of security / penetration-testing tools from GitHub.
Requires `git` and an active internet connection.

```python
from pyalltools import Kali

Kali.GetTools()  # runs git clone for each tool in the current directory
```

---

## Links

- **PyPI**: https://pypi.org/project/pyalltools/
- **Website**: https://techinfoak.wixsite.com/tech-info
- **YouTube**: https://youtube.com/@techinfoak

## License

MIT © Anupam Kanoongo
