Skip to main content

A modular Python toolkit providing utility functions, dictionaries, and configuration for development projects, structured around interfaces.

Project description

Project Name

tUilKit Current version 0.3.1

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.4.1.tar.gz (21.1 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.4.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tuilkit-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ce7d53c46cb52d16886ce9df31bfee199170398fa91cc88f2008a10941837d2e
MD5 e66f5764f23af85bd9134b098316a2a0
BLAKE2b-256 dc795e70ce3fc884e39303196ed397ec3c24fca8d5e832b5375027c9ac75f17f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tuilkit-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 21.3 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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d61a1562c8c1ec7645ced2b6138a499e09f103fe638a24f7f1f703668c3249a
MD5 319859effad39435122b0db1e96ea4f3
BLAKE2b-256 f9b8d7287474eb7bb9136a7759aa2e1a3b3a87099227558454c0596970d5409b

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