A lightweight Flask utility library providing validation, authentication decorators, and database helpers.
Project description
Ol_Utills
A lightweight Flask utility library providing validation, authentication decorators, and database helpers.
Installation
pip install ol-utills
Dependencies: flask, sqlite3, psycopg2, re
packages.py — API Reference
val — Validation
A class with static methods for validating common user inputs using regex.
| Method | Description |
|---|---|
val.chk_p(password) |
Validates password strength (min 8 chars, 1 uppercase, 1 lowercase, 1 digit, 1 special char) |
val.chk_e(email) |
Validates email format (RFC 2822 compliant) |
val.chk_ph(phone) |
Validates international phone numbers |
All methods return True if valid, None otherwise.
Example:
from packages import val
if val.chk_p("MyP@ss1234"):
print("Password is strong")
if val.chk_e("user@example.com"):
print("Email is valid")
req — Authentication Decorators
Decorators for protecting Flask routes with session-based authentication.
@req.login_required
Restricts a route to logged-in users. Checks session['logged'] == True.
from packages import req
@app.route('/dashboard')
@req.login_required
def dashboard():
return "Welcome to your dashboard"
@req.admin_required
Restricts a route to admin users. Checks session['admin'] == True.
@app.route('/admin')
@req.admin_required
def admin_panel():
return "Admin Panel"
res — Response Helpers
Utility class for building standardized API responses.
| Method | Description |
|---|---|
res.success_response(data) |
Returns a success JSON response (not yet implemented) |
res.error_response(message, code) |
Returns an error JSON response (not yet implemented) |
database — Database Connection
Provides quick database connection helpers.
database.sqlite(database)
Opens a connection to a SQLite database and returns a cursor.
from packages import database
db = database.sqlite("app.db")
db.execute("SELECT * FROM users")
results = db.fetchall()
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
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 ol_utills-0.5.0.tar.gz.
File metadata
- Download URL: ol_utills-0.5.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77da3a0fdb0027ac1c32f9896eddd91733246d1e3dadfaeb6fe80a46fbe3b580
|
|
| MD5 |
7a7d46f8e1c5e2be376860d69b845809
|
|
| BLAKE2b-256 |
89fdddbeabf755da81564bf14bf128e8d2c9d2723807917a3b7451516f644cfe
|
Provenance
The following attestation bundles were made for ol_utills-0.5.0.tar.gz:
Publisher:
publish.yml on OverLimit-OL/Ol_Utills
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ol_utills-0.5.0.tar.gz -
Subject digest:
77da3a0fdb0027ac1c32f9896eddd91733246d1e3dadfaeb6fe80a46fbe3b580 - Sigstore transparency entry: 1176186668
- Sigstore integration time:
-
Permalink:
OverLimit-OL/Ol_Utills@bd77a5dc44bf33f9889de3539255982eae239bc7 -
Branch / Tag:
refs/tags/0.5v - Owner: https://github.com/OverLimit-OL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd77a5dc44bf33f9889de3539255982eae239bc7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ol_utills-0.5.0-py3-none-any.whl.
File metadata
- Download URL: ol_utills-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7d4a6745c59976ce075de46f5dc089b54b56fa2e9ad2208e2500b3150eabca6
|
|
| MD5 |
c7f98a76977db8f13f6612c898af7581
|
|
| BLAKE2b-256 |
0378457ccf3f5dd60e08d1f0fd0572f73600200b2753be5f00b33825f3a19d57
|
Provenance
The following attestation bundles were made for ol_utills-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on OverLimit-OL/Ol_Utills
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ol_utills-0.5.0-py3-none-any.whl -
Subject digest:
f7d4a6745c59976ce075de46f5dc089b54b56fa2e9ad2208e2500b3150eabca6 - Sigstore transparency entry: 1176186716
- Sigstore integration time:
-
Permalink:
OverLimit-OL/Ol_Utills@bd77a5dc44bf33f9889de3539255982eae239bc7 -
Branch / Tag:
refs/tags/0.5v - Owner: https://github.com/OverLimit-OL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd77a5dc44bf33f9889de3539255982eae239bc7 -
Trigger Event:
release
-
Statement type: