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(
"Enter your age: ",
type="int",
min=0,
except_msg = Please enter a valid age
)
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(
"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",
validation=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 |
validation |
bool |
Enables validation protocol | False |
validation_msg |
string |
Validation confirmation message | Enter 1 to confirm the input |
validation_caractere |
string / int / float |
Value required to validation input | 1 |
language |
EN / FR |
Output language used for automatic responses | EN |
💡 Example With Validation
Python
from matheric import secureinput
code = secureinput(
msg="Enter access code : ",
type="string",
str_length=6,
validation=True,
validation_msg="Confirm the code [y/N] "
validation_caractere="y"
)
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 library.
📜 License
This project is licensed under the
👨💻 Author
Orphéric SANGNIDJO
Metadata
Release files for matheric 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| matheric-0.1.2.tar.gz | 7.3 kB | Without provenance | Details for matheric-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matheric-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for matheric-0.1.2-py3-none-any.whl |
Total release size: 14.4 kB
Release files / matheric-0.1.2.tar.gz
| Download URL | matheric-0.1.2.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
426bcb87e4bd61797ba038f5b2ce182a612c8c80a3437028441384d135b58b6a
|
|
BLAKE2b-256 checksum How to use checksums |
134e56fb3b8bffafd7695bb02479dc92ad6618d21deda02c85224a283820d8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / matheric-0.1.2-py3-none-any.whl
| Download URL | matheric-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2b8219ced2c38a53d7a94444d78ac1de885eac65fe8ae2a09a0594de64b5dad
|
|
BLAKE2b-256 checksum How to use checksums |
43ae9e4c98984d5ed8149d408d067d9bd472c13fdbea9e480be8603d7f4020dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for matheric 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.