Skip to main content

TolMate ;-P

Project description

License: GPL v3 Downloads Made with Python Pre-Release

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:

Tolerances


  • Tol 1±: Normal range (no news, good news)

  • Tol 2±: Soft warning
Soft Warning
  • Tol 3±: Hard warning
Critical Warning
  • Outside tolerances: Error
Error
  • 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.
  • 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 tolmate 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("\nEnter the temperature in degrees Celsius: "))

    if tolmate(value, 20, 40, 10, 50, 0, 60):  # Example ranges
        kelvin = celsius_to_kelvin(value)
        print(f"\nThe temperature in Kelvin is: {kelvin:.2f}")
    else:
        print("\nThe 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-1.0.5.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

TolMate-1.0.5-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tolmate-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b13f93cfb0355c03e9b662f3d0fcf7dd30cdf9769a2326a5bc8ba57f6042c1b1
MD5 b6096ab6526243e0f862819616cc6288
BLAKE2b-256 abba5022e7521062676a5b06d3495fd58509279a5c4107676a64aa0d5bb2176d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for TolMate-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b7a67f14c5d29f0e43a90b360ade5a89e7973b274a761ade23329443ba3b91
MD5 bdf06ced262b076dbb84873df17417f0
BLAKE2b-256 c0590fca4cdc27abfe38f7bb14fc3c09cb31ee005d61233a6d10fac119fdc94c

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