Skip to main content

utilitz

utilitz is a versatile Python utility library designed to simplify common tasks such as data persistence, Excel table manipulation, system automation, and advanced pattern matching.

It is built with a modular approach, keeping the core library lightweight while providing powerful specialized modules through optional dependencies.

Current release: see package metadata.

🚀 Installation

Core (Lightweight)

Installs only the essential utilities for text, JSON, and object serialization.

pip install utilitz

With Specialized Modules

Install specific modules as needed to keep your environment lean:

# For Excel and Dataframe support
pip install utilitz[office]

# For GUI automation and Activity monitoring
pip install utilitz[gui]

# For Encryption and Decryption
pip install utilitz[crypto]

# Install everything
pip install utilitz[all]

✨ Key Features

📁 Core IO Utilities

Simple functions for saving and loading data without boilerplates.

  • save_text / load_text: Handle lists of strings.
  • save_json / load_json: Work with dictionary and list structures.
  • save_object / load_object: Convenient pickle serialization.

📊 Excel & Data (Optional: [office])

  • read_excel_table: Intelligently reads tables from Excel files, with support for row filtering based on regex patterns and dynamic range detection.
  • encode_column / decode_column: Convert between Excel column names (e.g., "A", "AB") and numeric indices.

🛡️ Crypto (Optional: [crypto])

  • Encryptor / Decryptor: Class-based encryption and decryption workflows using cryptography (Fernet) with password-based key derivation (PBKDF2).
  • CryptoInput / CryptoOutput: Normalize input data and preserve encrypted artifacts with the minimum metadata needed to restore the original payload.
  • Supports strings, files, directories, and picklable Python values.

🖥️ System & GUI (Optional: [gui])

  • monitor_keep_alive: Prevent system sleep by simulating activity when no user input is detected.
  • MonitorActivity: A simple class to track keyboard and mouse events.

🔍 Advanced Regex (utilitz.regex)

  • A specialized framework for building complex, readable, and reusable regex patterns with built-in decoding for common types like integers, decimal numbers, currencies, and dates.

🗺️ Path Management (utilitz.path)

  • locate_project: Easily find and set the project root directory.
  • set_source: Dynamically manage sys.path entries.

🛠 Usage Examples

Reading an Excel Table

from utilitz.excel import read_excel_table

# Read a table from an Excel file starting from column A
# and filtering rows that match a specific pattern.
df = read_excel_table("data.xlsx", checkcol="A", patterncol=r"^\d+")

Encrypting Data

from utilitz.crypto import Encryptor

secret = "My secret message"
password = "strong-password"

encrypted = Encryptor.from_string(secret).encrypt(password)
token = encrypted.to_string()
original = encrypted.to_decryptor().decrypt(password).to_string()

Encrypting Python Values

from utilitz.crypto import Encryptor

payload = {"name": "ana", "roles": ["admin", "editor"]}
password = "strong-password"

encrypted = Encryptor.from_value(payload).encrypt(password)
restored = encrypted.to_decryptor().decrypt(password).to_value()

Keeping the System Awake

from utilitz.sys import monitor_keep_alive

# Press 'ctrl' every 60 seconds if no activity is detected
monitor_keep_alive(seconds=60, key='ctrl')

📄 License

This project is licensed under the GNU General Public License v3 (GPLv3).

Metadata

Release files for utilitz 0.9.8

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

Source distribution (sdist)

Source distribution for utilitz 0.9.8
File Size Uploaded Provenance Actions
utilitz-0.9.8.tar.gz 933.6 kB Without provenance Details for utilitz-0.9.8.tar.gz

Built distribution (wheel)

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

Total release size: 995.4 kB

Release files / utilitz-0.9.8.tar.gz

Download URL utilitz-0.9.8.tar.gz
Size 933.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aaba0c87654f938351cb945e2da81ccd12fe6d768e4c19167a6e1cbd8b2e2fd1
BLAKE2b-256 checksum
How to use checksums
e87807d788b2752af57a1d15ee98fe8cbafc30f542bdc712d4a59d237bfdc79b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release files / utilitz-0.9.8-py3-none-any.whl

Download URL utilitz-0.9.8-py3-none-any.whl
Size 61.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
239939f4d836f8e6695452e1cefa4d2dda3213f04c475bdb1dce5e93f80d7bf2
BLAKE2b-256 checksum
How to use checksums
9db1891cd3175611c8e87cf4f64941f2434caf74480fcf750a2c1e6cdce162a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Security for utilitz 0.9.8

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.

Release history Release notifications | RSS feed

This release

0.9.8 This release

2 release files No provenance

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