Skip to main content

A toolkit with utility functions for various tasks.

Project description

Project Name

tUilKit

Description

tUilKit (formerly utilsbase) is a modular Python toolkit providing utility functions, dictionaries, and configuration for development projects.
The package is structured around clear interfaces for logging, colour management, file system operations, and configuration loading, making it easy to extend or swap implementations.
tUilKit is organized into three main components:

  • /config: JSON files for customization and configuration
  • /dict: Python dictionaries and constants (e.g., ANSI codes, RGB values)
  • /utils: Toolkit modules implementing the interfaces

Folder Structure

/src
    /tUilKit
        /config
            BORDER_PATTERNS.json        # Terminal/log output border patterns
            COLUMN_MAPPING.json         # DataFrame column mapping
            COLOURS.json                # Foreground text COLOUR_KEY and RGB Reference
            GLOBAL_CONFIG.json          # Folder paths and logging/display options
            config.py                   # ConfigLoader implementation
        /dict
            DICT_CODES.py               # ANSI escape code parts for sequencing
            DICT_COLOURS.py             # RGB ANSI escape codes for sequencing
        /interfaces
            colour_interface.py         # ColourInterface (abstract base class)
            config_loader_interface.py  # ConfigLoaderInterface (abstract base class)
            file_system_interface.py    # FileSystemInterface (abstract base class)
            logger_interface.py         # LoggerInterface (abstract base class)
        /utils
            fs.py                       # File system operations (FileSystem implementation)
            output.py                   # Printing/Debugging/Logging (Logger, ColourManager)
            pdf.py                      # PDF file utilities
            sheets.py                   # CSV/XLSX utilities
            formats.py                  # (Planned) Cell formatting utilities
            sql.py                      # SQL query utilities
            calc.py                     # Specialized calculations
            wallet.py                   # Specialized wallet utilities
            data.py                     # Specialized data utilities
    /tests
        /testLogs
        test_module.py                  # Tests for interfaces and project folder logic
        test_output.py                  # Tests for output/logging functions

Interfaces

tUilKit uses Python abstract base classes to define clear interfaces for:

  • LoggerInterface: Logging, coloured output, and border printing
  • ColourInterface: Colour formatting and ANSI code management
  • FileSystemInterface: File and folder operations
  • ConfigLoaderInterface: Configuration loading and path resolution

All implementations in /utils and /config inherit from these interfaces, ensuring modularity and testability.

Installation

Follow these instructions to install and set up the project:

# Navigate to the project directory
cd tUilKit

# (Optional) Create and activate a virtual environment
# python -m venv venv
# source venv/bin/activate  # On Windows use `venv\Scripts\activate`

# Install dependencies
pip install -r requirements.txt

Usage

Sample usage and tests can be found in the /tests folder.

# Example: Using Logger and ColourManager

from tUilKit.utils.output import Logger, ColourManager
import json, os

# Load colour config
COLOUR_CONFIG_PATH = os.path.join("src", "tUilKit", "config", "COLOURS.json")
with open(COLOUR_CONFIG_PATH, "r") as f:
    colour_config = json.load(f)

colour_manager = ColourManager(colour_config)
logger = Logger(colour_manager)

log_file = "example.log"
logger.colour_log("INFO", "This is a coloured log message.", log_file=log_file)
logger.log_done(log_file=log_file)

Contributing

If you would like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

We’re actively seeking contributors to help enhance tUilKit! Whether you’re passionate about terminal functionality, advanced data operations, or document creation, there’s plenty of room to leave your mark.

Areas for Contribution

  • Enhanced ANSI Sequences:
    • Fetching user keystrokes, moving cursor, background colours, advanced terminal features.
  • DataFrame / Spreadsheet Functionality:
    • Smart diff, smart merging, custom autoformatting.
  • LaTeX and PDF Functionality:
    • Reading/writing LaTeX, PDF manipulation (generation, formatting, searching, editing).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Thanks to everyone who contributed to this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuilkit-0.2.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuilkit-0.2.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file tuilkit-0.2.1.tar.gz.

File metadata

  • Download URL: tuilkit-0.2.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tuilkit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3271ffbf1fbf358b57ba243d52193c59953f14d9d736e31cf86c3e287e7f1994
MD5 1ae967098f06b95c9802919124fbc5bb
BLAKE2b-256 37fefd3c6180e10ff719801403cc8859e0dd727e843c4ec3af14a82108b4a61d

See more details on using hashes here.

File details

Details for the file tuilkit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tuilkit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tuilkit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e110d178e2c4634f28fceb267fa0bc09f3409c556cd83fa688bb0542a330ff3
MD5 c34aa94d21bf1b60fb31dbfb88b3ce8d
BLAKE2b-256 3a8acbe44fc9d4076206d02977dd2b737900b46b337c38bcfb7d0a9a212dbbb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page