Skip to main content

pyalltools

PyPI version Python License: MIT

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

License

MIT © Anupam Kanoongo

Metadata

Release files for pyalltools 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyalltools 3.3.0
File Size Uploaded Provenance
pyalltools-3.3.0.tar.gz 7.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyalltools 3.3.0
File Interpreter ABI Platform
pyalltools-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / pyalltools-3.3.0.tar.gz

Download URL pyalltools-3.3.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d897dcf7e196db02f8618410542e542407b9a8024cf00e481af19006c110697b
BLAKE2b-256 checksum
How to use checksums
3c5cc3682db80d915ff6d646ae598c1571eb7228367f0b8ccd27adb40ba48a86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / pyalltools-3.3.0-py3-none-any.whl

Download URL pyalltools-3.3.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3233b9e18bc1e3e711c82e1ea8e50f98185f5de1bf5f359f19cee01e676b922f
BLAKE2b-256 checksum
How to use checksums
50bd493ce833c22136cb56983b47c5d93a45f652ab7c9b637b6cdc4ff8caf99e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Security for pyalltools 3.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page