Skip to content

abuawaish/PyAwaish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyAwaish

PyAwaish is a Flask-based Python framework that simplifies creating MySQL-powered web applications with dynamic configuration, RESTful APIs, and CRUD operations.


🚀 Features

  • 🔧 Dynamic MySQL configuration via web UI
  • 🧩 Template rendering (templates/ support)
  • 🔄 Query execution via POST APIs
  • ✍️ CRUD operations (Insert, Delete, Update, Fetch)
  • 🌐 RESTful Flask endpoints
  • 🔐 Environment variable support for secure configuration

📦 Installation

git clone https://github.com/abuawaish/PyAwaish.git
cd PyAwaish
pip install -r requirements.txt
pip install PyAwaish

Set Environment Variables

export MYSQL_HOST=localhost
export MYSQL_USER=root
export MYSQL_PASSWORD=your_password
export MYSQL_DB=mydatabase
export SECRET_KEY=your_secret_key

▶ Usage

from PyAwaish.MysqlApplication import MysqlApplication

if __name__ == "__main__":
    app = MysqlApplication(secret_key="your_secret_key")
    app.execute(debug_mode=True, port_number=8080, host_address="127.0.0.1")

🔑 Secret Key Options

| Method             | Example                                        |
| ------------------ | ---------------------------------------------- |
| `.env` (full path) | `MysqlApplication(secret_key=r"C:\path\.env")` |
| `.env` (local)     | `MysqlApplication(secret_key=".env")`          |
| No key (default)   | `MysqlApplication()`                           |
| Custom string      | `MysqlApplication(secret_key="key")`           |

.env Example:

SECRET_KEY="YOUR_SECRET_KEY"

🌐 Endpoints

| Endpoint         | Description             |
| ---------------- | ----------------------- |
| `/`              | MySQL config page       |
| `/home`          | Home page               |
| `/config_mysql`  | POST - Configure MySQL  |
| `/execute_query` | POST - Execute SQL/CRUD |

🧾 Example Query (POST /execute_query)

{
  "operation": "insert",
  "table_name": "users",
  "columns": "name, email",
  "values": "'John Doe', 'john@example.com'"
}
  • Supported Operations: insert, delete, update, fetch_data, show_tables

📚 Dependencies

  • Flask

  • Flask-MySQLdb

  • python-dotenv

📦 Quick Installation (Recommended)

pip install PyAwaish

Access the demo here:

Watch the video

About

PyAwaish is a Python package available on the Python Package Index (PyPI) that is used for building dynamic, MySQL-powered applications

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors