Skip to main content

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

logger.py

Pre-made logging functionality, uses colours.py to colour the output of various logging levels. The following logging levels exist and are appropriately coloured:

  • DEBUG - Cyan
  • INFO - Cyan
  • SUCCESS - Green
  • WARNING - Yellow
  • ERROR - Red
  • CRITICAL - Red

Example usage:

from TrueGIXERJ_Utils.logger import logger
logger.debug("This is a debug message")
logger.info("This is an info message")
logger.success("This is a success message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical error message")

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
from TrueGIXERJ_Utils.logger import logger

print(red("This is an error message"))
print(sanitise("illegal:file/name.txt"))
logger.success("Yippee!")

Project Structure

TrueGIXERJ_Utils/
├── __init__.py
├── colours.py
├── files.py
└── logger.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.

Metadata

Release files for TrueGIXERJ-Utils 2025.2.27

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

Source distribution (sdist)

Source distribution for TrueGIXERJ-Utils 2025.2.27
File Size Uploaded
truegixerj_utils-2025.2.27.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TrueGIXERJ-Utils 2025.2.27
File Interpreter ABI Platform
truegixerj_utils-2025.2.27-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / truegixerj_utils-2025.2.27.tar.gz

Download URL truegixerj_utils-2025.2.27.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5bc498ef7ca7d4f95826a8f087cd077e4d9200157819b132a3bdde8958bdbb03
BLAKE2b-256 checksum
How to use checksums
574d449b72d15f4522ec84c8998fdc37107968cd19bd4546113c5e1cf773122c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / truegixerj_utils-2025.2.27-py3-none-any.whl

Download URL truegixerj_utils-2025.2.27-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d612d32f514b4cb492f28a1b419ff8999e9829c71904acb636a02ecffb8c263
BLAKE2b-256 checksum
How to use checksums
dd6df6f16ed325f358ec24c70cf9cfcbe35101f4c9d2b17278eb279f5f0d26b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2025.2.27 This release

2 release files

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