Skip to main content

TolMate ;-P

Project description

License: GPL v3

TolMate

TolMate is a Python utility for checking if a value falls within specified tolerance ranges. It provides feedback via console messages and popup windows to alert users about the status of the value, whether it's within range or outside specifications.


Features

  • Tolerance Checks: Supports up to three (optional) levels of tolerance ranges:
    • Tol 1: Normal range
    • Tol 2: Soft warning
    • Tol 3: Hard warning
  • Interactive Popups: Display user-friendly messages with color-coded warnings and action buttons.
  • Dynamic Value Rechecking: Modify values directly from the popup for re-evaluation.
  • Behavior Configuration: Enable or disable popups and console messages globally.
  • Simple API: Easy to integrate into your existing Python projects.

Soft Warning

Critical Warning

Error

  • Customizable Look: Highlight alerts with built-in symbols or emojis.
  • Reusable and Lightweight: Designed to integrate seamlessly into larger projects.

Installation

You can install TolMate using pip.

pip install tolmate

Requirements

  • Python 3.x
  • tkinter (comes pre-installed with Python)

Usage

Basic Example

from tol_mate import configure_behavior, tolmate

# Set global behavior for popups and messages (by default all True)
configure_behavior(show_popup=True, show_message=False)

# Main program example
def celsius_to_kelvin(celsius):
    """Convert Celsius to Kelvin."""
    return celsius + 273.15

# Main loop for initial value input
try:
    # Configure global behavior (example: enable both message and popup)
    value = float(input("Enter the temperature in degrees Celsius: "))

    if tol_mate(value, 20, 40, 10, 50, 0, 60):  # Example ranges
        kelvin = celsius_to_kelvin(value)
        print(f"The temperature in Kelvin is: {kelvin:.2f}")
    else:
        print("The value is outside specifications.")

except ValueError:
    print("Please enter a valid number!")

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

tolmate-0.7.673.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

TolMate-0.7.673-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file tolmate-0.7.673.tar.gz.

File metadata

  • Download URL: tolmate-0.7.673.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for tolmate-0.7.673.tar.gz
Algorithm Hash digest
SHA256 ded9a174819447413ce97006f298aa0afe166ac1b8ffa93321aa5a870897bf28
MD5 d7ec2853ace2e62310c14ecc86c297a2
BLAKE2b-256 594154f56633a8d26488a5bcebcbd998881a2bc56c24be3aad5d8474793fbcfb

See more details on using hashes here.

File details

Details for the file TolMate-0.7.673-py3-none-any.whl.

File metadata

  • Download URL: TolMate-0.7.673-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for TolMate-0.7.673-py3-none-any.whl
Algorithm Hash digest
SHA256 87dcb6686ed02e733b4dd574ffe1cdfb5b9fb4885d5a6f96f1dcceb399f8a42b
MD5 c1877a0365766a158d7c46807fdf8b0e
BLAKE2b-256 c8932cc0c2ce12e18a2cfe7c441d9d03d61d7aa7787f18e2283ef2db0551393d

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