Skip to main content

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

ol_utills-0.5.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

ol_utills-0.5.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for ol_utills-0.5.0.tar.gz
Algorithm Hash digest
SHA256 77da3a0fdb0027ac1c32f9896eddd91733246d1e3dadfaeb6fe80a46fbe3b580
MD5 7a7d46f8e1c5e2be376860d69b845809
BLAKE2b-256 89fdddbeabf755da81564bf14bf128e8d2c9d2723807917a3b7451516f644cfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for ol_utills-0.5.0.tar.gz:

Publisher: publish.yml on OverLimit-OL/Ol_Utills

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ol_utills-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7d4a6745c59976ce075de46f5dc089b54b56fa2e9ad2208e2500b3150eabca6
MD5 c7f98a76977db8f13f6612c898af7581
BLAKE2b-256 0378457ccf3f5dd60e08d1f0fd0572f73600200b2753be5f00b33825f3a19d57

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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