A modular Python library designed to simplify secure and flexible user input
Project description
🔐 Matheric
A modular Python library designed to simplify secure and flexible user input.
Matheric provides advanced console input utilities with built-in validation, retry systems, type checking and optional confirmation protocols.
✅ Features
- Secure and validated user input
- Automatic retry on invalid input
- Built-in type verification
- Integer and float range control
- String length validation
- Optional input confirmation system
- Custom exception messages
- Modular architecture
📦 Installation
Bash
pip install matheric
💡 Quick Example
Python
from matheric import secureinput
age = secureinput(
msg="Enter your age : ",
Type="int",
Min=0,
Max=120
)
print(age)
Supported Types
Matheric currently supports:
- "string"
- "int"
- "float"
String Validation
Python
name = secureinput(
"Enter your name : ",
type="string",
str_min=3,
str_max=20
)
The msg can be ommitted if it is placed first
Integer Validation
Python
number = secureinput(
msg="Enter a number : ",
type="int",
min=1,
max=10
)
Float Validation
Python
price = secureinput(
msg="Enter the price : ",
type="float",
min=0
)
Input Confirmation System
Python
password = secureinput(
msg="Enter password : ",
type="string",
validate=True
)
The validation system allows the user to confirm the entered value before final submission.
⚙️ Parameters
| Parameter | Type | Description | Default Value |
|---|---|---|---|
msg |
string |
Message displayed before input | |
type |
string / int / float |
Expected input type (string, int, float) |
string |
max |
int / float |
Maximum allowed numeric value | NotDefined |
min |
int / float |
Minimum allowed numeric value | NotDefined |
str_length |
int |
Exact required string length | Any |
str_max |
int |
Maximum allowed string length | NotDefined |
str_min |
int |
Minimum allowed string length | NotDefined |
except_msg |
string |
Message displayed on invalid input | Type ERROR |
validate |
bool |
Enables validation protocol | False |
validate_msg |
string |
Validation confirmation message | Enter 1 to confirm the input |
validation_caractere |
string / int / float |
Value required to validate input | 1 |
validation_caractere_type |
string / int / float |
Type of validation caractere | int |
validate_except_msg |
string |
Validation error message | Must be an integer |
💡 Example With Validation
Python
from matheric import secureinput
code = secureinput(
msg="Enter access code : ",
type="string",
str_length=6,
validate=True,
validate_msg="Enter 1 to confirm the code : "
)
Project Structure
matheric/
│
├── pyproject.toml
├── README.md
├── LICENSE
│
└── src/
└── matheric/
├── __init__.py
│
├── secure_input/
│ ├── __init__.py
│ └── input.py
│
└── utils/
├── __init__.py
└── helpers.py
🖥️ Command Line
After installation:
Bash
matheric
Displays general information about the framework.
📜 License
This project is licensed under the
👨💻 Author
Orphéric SANGNIDJO
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 matheric-0.1.0.tar.gz.
File metadata
- Download URL: matheric-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9991437fa226b2358618d3331753ee63637b39712cef02c7acb1f3881e0df13c
|
|
| MD5 |
b00f153b609c4b6c35a6b12507dc8ad0
|
|
| BLAKE2b-256 |
858ecec1302644f024780bb0de3470cd52737bccc2d9a35236d88183532a47a3
|
File details
Details for the file matheric-0.1.0-py3-none-any.whl.
File metadata
- Download URL: matheric-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c37f60a10b532283a3ba78e71c499ffce925485de4c490e9632648facc257219
|
|
| MD5 |
f37a778c758e0de371554d1123c6cd50
|
|
| BLAKE2b-256 |
e5f3fe6a85799feb64c71ee2bbeb0f4c620f7269d13b1b3052dc187ffd7cbd6a
|