a collection of small python utilities to use across various projects.
Project description
TrueGIXERJ_Utils
A collection of small but useful utility functions for use across multiple types of projects. Originally made for personal use, but made publicly available for anyone who might find them useful. This package will be continuously expanded with functions that I need — or may need — across different projects, so I don’t have to rewrite them every time (i'm lazy).
And yes, British spelling throughout, because I’m British.
Features
Currently, TrueGIXERJ_Utils includes:
colours.py
Functions to return coloured terminal text using ANSI escape codes, useful for logging or styling console output.
red(text: str) -> str: Returns the input text in red.
yellow(text: str) -> str: Returns the input text in yellow.
green(text: str) -> str: Returns the input text in green.
cyan(text: str) -> str: Returns the input text in cyan.
Example usage:
from TrueGIXERJ_Utils.colours import red
print(red("Error: Something went wrong!"))
files.py
File utility functions, currently including:
sanitise(filename: str) -> str: Cleans up a filename by:
-
Removing non-ASCII characters
-
Stripping special characters not allowed in filenames
-
Removing trailing spaces and dots
-
Avoiding reserved names in Windows (e.g., CON, PRN, NUL, etc.)
Example usage:
from TrueGIXERJ_Utils.files import sanitise
clean_name = sanitise("my*illegal:file?.txt")
print(clean_name) # Output: myillegalfile.txt
Installation
This package is available on PyPI, and can be installed by running:
pip install TrueGIXERJ-Utils
Alternatively, it can be manually installed by cloning the git repository:
git clone https://github.com/YourUsername/TrueGIXERJ_Utils.git
Usage
Simply import the necessary modules and use the functions as described above.
from TrueGIXERJ_Utils.colours import red, green
from TrueGIXERJ_Utils.files import sanitise
print(red("This is an error message"))
print(green("Success!"))
print(sanitise("illegal:file/name.txt"))
Project Structure
TrueGIXERJ_Utils/
├── __init__.py
├── colours.py
└── files.py
License
This project is licensed under the GNU General Public License v3.0. See the LICENCE file for details.
Contributing
Due to the nature of the project, I will be updating it on an "as and when" basis. However; if you have any suggestions or improvements, feel free to submit a pull request or open an issue on GitHub. Or just come and shout at me loudly on my personal Discord.
Project details
Release history Release notifications | RSS feed
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 truegixerj_utils-2025.2.20.tar.gz.
File metadata
- Download URL: truegixerj_utils-2025.2.20.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a059b1b857e9531c16e31fee3b689521fb6c7b639d436480850ee48ef405dc4
|
|
| MD5 |
d66a7e720ab5714f3eca84f1d55f364f
|
|
| BLAKE2b-256 |
2a077c03c5e11077816dc417885231c885197c5c2481248ddc6ccd89a9e1cf73
|
File details
Details for the file truegixerj_utils-2025.2.20-py3-none-any.whl.
File metadata
- Download URL: truegixerj_utils-2025.2.20-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0056b8e300dd9f98da55cacc81e15ab3ad348744ac1e66ce1dca6eacba9b256b
|
|
| MD5 |
0b0e3887075c340ac01eb6caf8ed0252
|
|
| BLAKE2b-256 |
4dbb51da34fa6baf2160e1ebbb6a7c90a4f4eaa8630cd85c56c4394ac627e357
|