pyalltools
A collection of everyday Python utilities — integer math, string analysis, data-structure helpers, and more — packaged for easy reuse.
Installation
pip install pyalltools
Quick Start
from pyalltools import Int, Str, List, MyTuple, Stack, Queue, binary_search
Classes & Usage
Int(number)
Integer utilities.
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.
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.
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.
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.
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.
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).
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.
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyalltools-3.3.0.tar.gz.
File metadata
- Download URL: pyalltools-3.3.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d897dcf7e196db02f8618410542e542407b9a8024cf00e481af19006c110697b
|
|
| MD5 |
d331bd20a554d8c6fe691460162ab8f0
|
|
| BLAKE2b-256 |
3c5cc3682db80d915ff6d646ae598c1571eb7228367f0b8ccd27adb40ba48a86
|
File details
Details for the file pyalltools-3.3.0-py3-none-any.whl.
File metadata
- Download URL: pyalltools-3.3.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3233b9e18bc1e3e711c82e1ea8e50f98185f5de1bf5f359f19cee01e676b922f
|
|
| MD5 |
a26f1d4330e2b9ee2957e94fe77553cd
|
|
| BLAKE2b-256 |
50bd493ce833c22136cb56983b47c5d93a45f652ab7c9b637b6cdc4ff8caf99e
|