Simple Complaint Management System in Python with Source Code

Simple Complaint Management System in Python with Source Code

Simple Complaint Management System in Python

Are you looking for a basic yet functional project to enhance your Python skills? The Simple Complaint Management System is an ideal mini project designed specifically for beginners. It’s an easy-to-use console-based application that enables users to add and view complaints, making it an excellent introduction to working with databases and user input in Python.

About the Project

The Simple Complaint Management System project is developed in Python, and its functionality is simple but effective. The project files include key Python scripts such as main.py, db.py, and listComp.py. This mini project focuses on core functionalities such as adding new complaints and viewing existing complaints, providing a straightforward experience for users without complex logins or registration.

Download New Real Time Projects :-Click here

Core Features

  1. Add Complaints:
    Users can submit complaints quickly and easily. When adding a complaint, users are prompted to provide:
  • Full Name
  • Gender (chosen from options)
  • Complaint/Comments This data is stored in the external database, making the system efficient for keeping records of all submitted complaints.
  1. List Complaints:
    Users can view all submitted complaints, displayed with their respective details, including:
  • ID number (auto-generated)
  • Name
  • Gender
  • Complaint

This makes it easy for an administrator or user to view the list of complaints, making the system useful for small-scale organizations or educational environments looking to manage feedback or issues.

See also  Supplier Management System in Java with Free Code

https://updategadh.com/category/php-project

Database Integration

This project’s utilization of an external database is one of its highlights. Instead of keeping the data temporarily in memory, all complaints are stored permanently in a database, allowing users to retrieve and view complaint lists anytime. This feature provides a strong learning experience for beginners in Python, giving them exposure to database connections and data management.

Why This Project is Perfect for Beginners

This Simple Complaint Management System serves as a perfect stepping stone for those new to Python programming. It introduces essential concepts such as:

  • Handling user inputs through the console
  • Database connectivity and storage
  • Displaying data in a user-friendly format

By working on this project, beginners will get hands-on experience with creating a basic management system, giving them the confidence to tackle more complex projects down the road.

Use for Educational Purposes

The Simple Complaint Management System in Python is free to download and use for educational purposes. It’s a great tool for learning the basics of Python, database integration, and console-based application development. It is not intended for commercial use, but can serve as a valuable learning resource.

Project Features

  • Add new complaints
  • View complaint list
  • Permanent database storage for complaints
  • Simple and easy-to-use interface

Here’s the source code for the Simple Complaint Management System in Python. This project includes the essential features of adding complaints and viewing complaint lists, with basic database interaction.

See also  Data Types in PHP

Source Code

1. main.py

This is the main file that runs the application and interacts with the user.

import db  # Import the database module
import listComp  # Import the module for listing complaints

def menu():
    print("\nSimple Complaint Management System")
    print("1. Add Complaint")
    print("2. View Complaints")
    print("3. Exit")
    choice = input("Enter choice: ")
    return choice

def add_complaint():
    print("\nEnter Complaint Details")
    full_name = input("Full Name: ")
    gender = input("Gender (M/F): ")
    comments = input("Complaint: ")

    # Store the complaint in the database
    db.add_complaint(full_name, gender, comments)
    print("Complaint added successfully!\n")

def view_complaints():
    print("\nList of Complaints:")
    listComp.show_complaints()

if __name__ == "__main__":
    while True:
        choice = menu()
        if choice == "1":
            add_complaint()
        elif choice == "2":
            view_complaints()
        elif choice == "3":
            print("Exiting the system.")
            break
        else:
            print("Invalid choice! Please try again.")

2. db.py

This module handles database-related operations, such as adding complaints and fetching them.

import sqlite3

# Connect to the SQLite database (or create it if it doesn't exist)
connection = sqlite3.connect('complaints.db')
cursor = connection.cursor()

# Create the complaints table if it doesn't exist
cursor.execute('''
CREATE TABLE IF NOT EXISTS complaints (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    gender TEXT NOT NULL,
    comments TEXT NOT NULL
)
''')
connection.commit()

# Function to add a complaint to the database
def add_complaint(name, gender, comments):
    cursor.execute('''
    INSERT INTO complaints (name, gender, comments)
    VALUES (?, ?, ?)
    ''', (name, gender, comments))
    connection.commit()

# Function to fetch all complaints from the database
def get_complaints():
    cursor.execute('SELECT * FROM complaints')
    return cursor.fetchall()

3. listComp.py

This module is responsible for displaying the list of complaints.

import db  # Import the database module to fetch complaints

# Function to display the complaints
def show_complaints():
    complaints = db.get_complaints()
    if len(complaints) == 0:
        print("No complaints found.")
    else:
        print("\nID | Name | Gender | Complaint")
        print("-" * 40)
        for complaint in complaints:
            print(f"{complaint[0]} | {complaint[1]} | {complaint[2]} | {complaint[3]}")

How to Run the Project

  1. Copy and save each code block into separate Python files: main.py, db.py, and listComp.py.
  2. Ensure you have SQLite installed (which comes built-in with Python).
  3. Run main.py in your terminal or IDE.
See also  Movie Management System in Python with Source Code

How It Works

  • Adding Complaints: The user enters their name, gender, and complaint details. This data is saved in the complaints.db database.
  • Viewing Complaints: The system fetches all the complaints from the database and displays them in a list format.

This simple system is perfect for beginners to learn Python’s database interaction and basic console application development.

  • design a complaint management system project in python code
  • simple complaint management system in python w3schools
  • simple complaint management system in python pdf
  • simple complaint management system in python example
  • complaint management system project in python ppt
  • complaint-management-system project in python github
  • complaint management system project code
  • complaint management system django
Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *