inpsPyPI
inpsPyPI is a multipurpose Python utility library providing database wrappers, Excel automation tools, custom data structures, classical cryptography ciphers, sorting algorithms, type converters, and validation helpers.
Installation
pip install inpsPyPI # core library (no third-party dependencies)
pip install "inpsPyPI[excel]" # adds openpyxl for the excellent_reader module
Top-level imports are lazy, so import inpsPyPI is nearly free; modules load on first use.
Table of Contents
- Data Structures & Collections
- Database & File I/O
- Algorithms & Cryptography
- Validation & Utilities
- Running Unit Tests
- Migrating to 2.0
Data Structures & Collections
Dictionarily
A wrapper around standard Python dictionaries with custom sorting capabilities.
from inpsPyPI import Dictionarily
d = Dictionarily()
d.add("b", 2)
d.add("a", 1)
d.add(2, "two")
d.add(1, "one")
# Sort lexicographically by key/value representation
d.sort()
# Sort with numerical keys preceding string keys
d.sort_numbers_first()
# Retrieve internal dict
print(d.show()) # {1: 'one', 2: 'two', 'a': 1, 'b': 2}
Memory
A dynamic in-memory list storage container.
from inpsPyPI import Memory
mem = Memory()
mem.add("data1")
mem.add("data2")
count = mem.count() # 2 (also len(mem))
exists = mem.contains("data1") # True (also "data1" in mem)
item = mem.get(0) # "data1"
mem.remove("data1") # Removes first matching element
mem.remove_at(0) # Removes (and returns) element by index
mem.clear() # Resets internal storage
Stackily
A LIFO (Last-In, First-Out) stack implementation.
from inpsPyPI import Stackily
stack = Stackily()
stack.push("first")
stack.push("second")
top_item = stack.peek() # "second" (does not remove)
popped = stack.pop() # "second" (removed and returned)
size = stack.size() # 1
empty = stack.is_empty() # False
items_list = stack.to_list() # ["first"] (a copy)
pop() and peek() raise IndexError on an empty stack.
Database & File I/O
EasySQL
A lightweight SQLite helper that abstracts SQL boilerplate with dictionaries. Table and column names must be valid identifiers ([A-Za-z_][A-Za-z0-9_]*); they are validated and quoted. Values are always parameterized.
from inpsPyPI import EasySQL
# Connects to 'app_database.db'
sql = EasySQL("app_database")
sql.create_table("users", {
"id": "INTEGER PRIMARY KEY",
"name": "TEXT",
"email": "TEXT"
})
sql.insert_to_table("users", {"id": 1, "name": "Alice", "email": "alice@example.com"})
# Bulk insert: one connection and one transaction for all rows
sql.insert_many("users", [
{"id": 2, "name": "Bob", "email": "bob@example.com"},
{"id": 3, "name": "Cara", "email": "cara@example.com"},
])
rows = sql.get_table_values("users")
sql.print_table("users")
sql.delete_from_table("users", {"id": 1})
sql.clear_table("users") # DELETE FROM users
sql.delete_table("users") # DROP TABLE IF EXISTS users
Excellent Reader (Excel Helper)
Utilities for reading and writing column data in .xlsx files using openpyxl (install with pip install "inpsPyPI[excel]"). Default skip_rows=2 skips headers. Empty cells are returned as "". Errors such as FileNotFoundError or IndexError propagate to the caller.
from inpsPyPI import excellent_reader
file = "data.xlsx"
# --- Reading Data ---
first_col = excellent_reader.get_first_column_from_sheet_index(file, index=0, skip_rows=2)
col_b = excellent_reader.get_n_column_from_sheet_index(file, index=0, column="B", skip_rows=2)
all_first_cols = excellent_reader.get_first_column_from_all_sheets(file, skip_rows=2)
all_c_cols = excellent_reader.get_n_column_from_all_sheets(file, column="C", skip_rows=2)
# --- Writing Data ---
excellent_reader.set_first_column_from_sheet_index(file, index=0, value=["Val1", "Val2"], skip_rows=2)
excellent_reader.set_n_column_from_sheet_index(file, index=0, column="B", value="StaticValue", skip_rows=2)
excellent_reader.set_first_column_from_all_sheets(file, value="Updated", skip_rows=2)
excellent_reader.set_n_column_from_all_sheets(file, column="D", value=["Row1", "Row2"], skip_rows=2)
# --- Error handling ---
try:
excellent_reader.get_first_column_from_sheet_index("missing.xlsx", 0)
except FileNotFoundError:
...
SimpleFileHandler
Static file I/O operations with default UTF-8 encoding.
from inpsPyPI import SimpleFileHandler
SimpleFileHandler.write("sample.txt", "Hello World") # overwrites
SimpleFileHandler.append("sample.txt", "\nNext line")
content = SimpleFileHandler.read("sample.txt")
Algorithms & Cryptography
Cipher
Classical text ciphers for uppercase alphabetic characters (spaces and non-alphabetic characters are preserved). Non-letter characters in keywords are ignored; Caesar shifts of any size (including negative) wrap correctly.
from inpsPyPI import Cipher
Cipher.caesar_cipher("HELLO WORLD", 3) # 'KHOOR ZRUOG'
Cipher.keyword_cipher("HELLO WORLD", "KEYWORD") # 'AOGGJ UJNGW'
Cipher.giovanni_cipher("HELLO WORLD", "KEYWORD", "C") # 'RYCCH SHLCE'
Cipher.transposition_cipher("HELLO WORLD") # 'HLOOLELWRD'
Sort
A collection of sorting algorithms. Every function returns a new list and never mutates its input.
| Function | Description | Supported Input |
|---|---|---|
bubble_sort(arr) |
Bubble sort (early exit) | Generic list |
cocktail_shaker_sort(arr) |
Bidirectional bubble sort | Generic list |
odd_even_sort(arr) |
Odd-even transposition sort | Generic list |
selection_sort(arr) |
Selection sort | Generic list |
insertion_sort(arr) |
Insertion sort | Generic list |
shellsort(arr) |
Shell sort | Generic list |
quicksort(arr) |
Quicksort (3-way partition) | Generic list |
merge_sort(arr) |
Stable merge sort | Generic list |
heapsort(arr) |
Heapsort via heapq |
Generic list |
introsort(arr) |
Quicksort (median-of-3) with heapsort fallback | Generic list |
timsort(arr) |
Standard Python Timsort | Generic list |
counting_sort(arr) |
Counting sort | Integers (negatives OK) |
bucket_sort_uniform(arr) |
Uniform bucket sort | Floats in range $[0.0, 1.0)$ |
pigeonhole_sort(arr) |
Pigeonhole sort | Integers (negatives OK) |
patience_sorting(arr) |
Patience sorting via piles | Generic list |
bogosort(arr) |
Randomized bogo sort (educational; keep lists tiny) | Generic list |
bead_sort(arr) |
Gravity / Bead sort | Non-negative integers |
from inpsPyPI import sort
data = [5, 2, 9, 1, 5, 6]
sorted_data = sort.quicksort(data) # data is unchanged
uniform_floats = [0.89, 0.56, 0.65, 0.12, 0.66]
sorted_floats = sort.bucket_sort_uniform(uniform_floats)
Validation & Utilities
Calculators
Geometric calculations (2D areas, 3D surface areas) and the Collatz sequence. Negative dimensions raise ValueError.
from inpsPyPI import AreaCalculator, CollatzCalculator
# --- 2D Shapes ---
AreaCalculator.square_area(4.0) # 16.0
AreaCalculator.rectangle_area(4.0, 5.0) # 20.0
AreaCalculator.triangle_area(10.0, 4.0) # 20.0
AreaCalculator.circle_area(5.0) # 78.54
AreaCalculator.sector_area(5.0, 60.0) # 13.09
AreaCalculator.segment_area(5.0, 60.0) # 2.26
vertices = [(0, 0), (4, 0), (4, 3), (0, 3)]
AreaCalculator.polygon_shoelace_area(vertices) # 12.0
# --- 3D Surface Areas ---
AreaCalculator.cube_surface_area(3.0) # 54.0
AreaCalculator.cylinder_surface_area(3.0, 10.0) # 245.04
AreaCalculator.sphere_surface_area(3.0) # 113.10
# --- Collatz ---
CollatzCalculator.calculate(6) # [6, 3, 10, 5, 16, 8, 4, 2, 1]
for n in CollatzCalculator.iterate(27): # lazy, O(1) memory
...
Check
Input validation and network connectivity checkers.
from inpsPyPI import Check, EmailDomainValidator
# --- Email validation (recommended: your own validator instance) ---
validator = EmailDomainValidator(names=["gmail"], extensions=["com"])
validator.is_valid("user@gmail.com") # True (case-insensitive)
full = EmailDomainValidator(domains=["company.co.uk"], use_full_domain=True)
full.is_valid("user@company.co.uk") # True
# --- Legacy global API (still supported; shares state process-wide) ---
Check.Email.add_valid_domain_name("gmail")
Check.Email.add_valid_domain_extension("com")
Check.Email.should_use_full_domain(False)
Check.Email.is_valid("user@gmail.com") # True
Check.Email.reset() # clear the shared configuration
# --- String analysis ---
Check.is_a_valid_philippine_mobile_number("+639171234567") # True
Check.is_all_numbers("123456") # True
Check.has_numbers("User123") # True
Check.has_symbols("hello@world") # True
Check.has_spaces("Hello World") # True
# --- Network status ---
has_internet = Check.is_connected() # True if 8.8.8.8:53 is reachable
Convert
Type conversions and encoding transformations. Hex and binary conversions operate on UTF-8 bytes, so all characters (including emoji and CJK) round-trip.
from inpsPyPI import Convert
Convert.reverse("python") # "nohtyp"
Convert.to_real_name("jOHN") # "John"
b64_str = Convert.to_base64("hello") # "aGVsbG8="
orig_str = Convert.from_base64(b64_str) # "hello"
hex_str = Convert.to_hex("hello") # "68656C6C6F"
from_hex = Convert.from_hex(hex_str) # "hello"
bin_str = Convert.to_binary("hello") # "0110100001100101011011000110110001101111"
from_bin = Convert.from_binary(bin_str) # "hello"
byte_arr = Convert.to_byte_array("hello") # b'hello'
from_byte = Convert.from_byte_array(byte_arr) # "hello"
Convert.to_int("100") # 100
Convert.to_float("3.14") # 3.14
Convert.to_double("3.14") # 3.14 (alias of to_float)
Convert.to_long("100000") # 100000 (alias of to_int)
Flask Jsonify Helper (bake)
Wraps any payload into a standardized dictionary response.
from inpsPyPI import bake
bake("Success")
# {'response_data': 'Success'}
bake({"status": 200, "user": "admin"})
# {'response_data': {'status': 200, 'user': 'admin'}}
Running Unit Tests
pip install -e ".[excel]" pytest
python -m pytest # or: python -m unittest discover tests
Migrating to 2.0
excellent_readernow raises (FileNotFoundError,IndexError, ...) instead of printing and returningNone/False, and empty cells read as""instead of"NONE". It requirespip install "inpsPyPI[excel]".- Sorting functions never mutate their input; use the returned list.
test_method/inpsPyPI.testwere removed.- Hex/binary conversion now encodes UTF-8 bytes (identical output for ASCII).
EasySQLrejects table/column names that are not plain identifiers.Check.Emailstill works but is case-insensitive and compares the real TLD; preferEmailDomainValidator.
Metadata
Release files for inpsPyPI 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inpspypi-2.0.0.tar.gz | 21.4 kB | With provenance | Details for inpspypi-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inpspypi-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for inpspypi-2.0.0-py3-none-any.whl |
Total release size: 40.7 kB
Release files / inpspypi-2.0.0.tar.gz
| Download URL | inpspypi-2.0.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4efd974a425473374b55b7d981c22f318eba27ed0aff474885cb51aeb0763129
|
|
BLAKE2b-256 checksum How to use checksums |
160502f4c75e18ba0c2c2986630ccd6e6e23c5982be90aeb968eb3ca12f7263c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / inpspypi-2.0.0-py3-none-any.whl
| Download URL | inpspypi-2.0.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4e824acdff2e68b6093c8d0f2a1a20bab6c8085c245341e99c3ff4195955847
|
|
BLAKE2b-256 checksum How to use checksums |
201cbcd9e4f2a794bc625d21f9ac61cf3d5657915cc6a126d809765c963bcb3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for inpsPyPI 2.0.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for inpspypi-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA 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.