Skip to main content

Universal template for PyQt6 + PyMySQL applications with role-based access control

Project description

PyQt Template App

Universal template for creating PyQt6 + PyMySQL applications with role-based access control (Admin, Manager, Client).

Features

  • 🎯 Universal Template - Easily adaptable to any domain (hotels, car rentals, e-commerce, etc.)
  • 🔐 Role-Based Access - Built-in support for Admin, Manager, and Client roles
  • 📊 Complete GUI - Full-featured PyQt6 interface with tabs and forms
  • 🗄️ Database Integration - Ready-to-use PyMySQL integration
  • ⚙️ Centralized Configuration - All settings in one config.py file
  • 🔒 SQL Injection Protection - Parameterized queries throughout

Quick Start

Installation

pip install stdd

Basic Usage

Using Templates

  1. Copy the template files to your project directory
  2. Configure config.py with your database settings and table names
  3. Create your database structure
  4. Customize SQL queries in the window modules
  5. Run your application

Using Examples

After installation, you can access the example application:

# Access example files
import std.examples.main as example_app
# or find them at: site-packages/std/examples/

Project Structure

std/
├── config.py                      # Configuration (START HERE!)
├── template_db.py                 # Database module
├── template_main.py               # Entry point
├── template_login_window.py       # Login window
├── template_admin_window.py       # Admin window
├── template_manager_window.py     # Manager window
├── template_client_window.py      # Client window
├── example_database_structure.sql # Example database structure
├── README_template.md             # Detailed instructions
└── examples/                      # Working example application
    ├── main.py                    # Example entry point
    ├── db.py                      # Example database module
    ├── login_window.py            # Example login window
    ├── admin_window.py            # Example admin window
    ├── manager_window.py          # Example manager window
    └── client_window.py           # Example client window

Configuration

All settings are in config.py:

DB_CONFIG = {
    'host': 'localhost',
    'user': 'root',
    'password': 'root',
    'database': 'your_database',
    'charset': 'utf8mb4'
}

TABLES = {
    'users': 'users',
    'roles': 'roles',
    'items': 'items',      # Your main entity table
    'orders': 'orders',    # Your orders/bookings table
    # ... more tables
}

Example: Car Rental System

TABLES = {
    'users': 'users',
    'roles': 'roles',
    'items': 'cars',           # cars instead of items
    'orders': 'rentals',       # rentals instead of orders
    'categories': 'car_types', # car types instead of categories
    # ...
}

Requirements

  • Python >= 3.8
  • PyQt6 >= 6.6.0
  • PyMySQL >= 1.1.0

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or suggestions, please open an issue on GitHub.


Made with ❤️ for the Python community

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

stdd-0.1.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

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

stdd-0.1.0-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file stdd-0.1.0.tar.gz.

File metadata

  • Download URL: stdd-0.1.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for stdd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8e073ed45126cfc49cf931d8e2accfac8c15d4a4649adf6e63fc02872c04753
MD5 0cccd5de09a15e0c402d43fbc084164d
BLAKE2b-256 b3bf9b03068c03df33e239450cc98f90710ff841479acb3dcbdc6099e20dcb6a

See more details on using hashes here.

File details

Details for the file stdd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stdd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for stdd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 806aa2bf756e1665a38f0eb5761d545acafb0c74f51b729921ff9488ac360d7a
MD5 b8368765862d24a04a22a3f931e642f0
BLAKE2b-256 87ebe49537bb62b80d70613ffbe0e6f0d739de005bd91eb6569595a089016a02

See more details on using hashes here.

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