TolMate ;-P
Project description
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
- Configurable Behavior: Choose whether to show console messages, popups, or both.
- Interactive Popups: Allow users to confirm or change the value directly.
- 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
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("Enter the temperature in degrees Celsius: "))
if tolmate(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tolmate-0.5.1004.tar.gz.
File metadata
- Download URL: tolmate-0.5.1004.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d81af84099ceceb2522c517c85373a6098ee708040d18daa1e8bc65f7da61afe
|
|
| MD5 |
dd06daf0e20909a89380291aa034239c
|
|
| BLAKE2b-256 |
4dbecfc649080a00cbd9bfe51b95392fbc814e02d92172f9cede125db3e74eff
|
File details
Details for the file TolMate-0.5.1004-py3-none-any.whl.
File metadata
- Download URL: TolMate-0.5.1004-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ddb3a0d5901b86b1cc3e5ed4af2068006bc9a97d9cf9e4c3f03218fd1315312
|
|
| MD5 |
9913d3c1cf5dcc3f3262cb7aaad6e793
|
|
| BLAKE2b-256 |
d5a7e61c3cbcaa1018dbaa4f2ed2ed51b15cc0360f1f20cc298417a41c8b8f1f
|