A comprehensive Vehicle Rental Management Application built with Python and Tkinter.
Created for the Object Oriented Programming (OOP) University Module.
This project is a desktop-based application designed to streamline the operations of a vehicle rental agency. It allows office staff to manage a fleet of vehicles, handle customer rentals, and track availability in real-time.
The core objective of this project was to demonstrate robust Object-Oriented Programming (OOP) principles in a practical, real-world scenario. The application features a responsive graphical user interface (GUI) built with Tkinter and uses a persistent CSV-based database system.
- Secure Authentication: Staff login and registration system.
- Data Encapsulation: User credentials and sessions are securely managed within the application structure.
- Visual Grid Display: Vehicles are displayed in a responsive grid layout with images and status indicators.
- Smart Filtering: Filter vehicles by Type (e.g., Car, Van, SUV) or Price (Low-to-High / High-to-Low).
- Instant Search: Real-time search functionality to find vehicles by Make, Model, or Type.
- Availability Tracking: Visual cues indicate if a vehicle is "Available" (Green) or "Rented" (Red).
- Streamlined Booking: Intuitive workflows for renting out vehicles to customers.
- Customer Database: Stores customer details (Name, Address, Tel) associated with each rental.
- Rental History: Tracks rent dates, proposed return dates, and actual returns.
This project is architected around four fundamental OOP concepts:
-
Encapsulation:
- Classes like
User,Vehicle, andRentalbundler data (attributes) and behavior (methods) together. - Access to internal state is controlled using properties and private attributes (e.g.,
self._username).
- Classes like
-
Abstraction:
- The
DatabaseManagerclass hides the complexity of CSV file handling. The main application pushes and pulls data without knowing the underlying storage details.
- The
-
Inheritance:
- The main application class,
VehicleRentalApp, inherits fromtk.Tk, gaining all the properties of a standard GUI window while extending it with custom rental logic.
- The main application class,
-
Polymorphism:
- The display logic implicitly treats all vehicle objects uniformly, whether they are different types or filtered results, allowing for flexible and reusable code components.
- Language: Python 3.x
- GUI Framework: Tkinter (Standard Python GUI)
- Image Processing: Pillow (PIL Fork)
- Data Storage: CSV (Comma Separated Values) text files
Ensure you have Python installed. You also need the Pillow library for handling images.
pip install Pillow- Clone or Download the repository to your local machine.
- Navigate to the project directory.
Execute the main script:
python main.pyNote: On the first run, the application will automatically create an
imagesfolder and generate necessary CSV files (users.csv,vehicles.csv,rentals.csv). It may ask you to restart to populate the images folder with real vehicle photos.
The application looks for images in the images/ directory. If missing, it uses a placeholder. For the best experience, add .jpg images matching the vehicle definitions (e.g., toyota_corolla.jpg).
main.py: The entry point and core source code containing all classes and logic.users.csv: Stores staff login credentials.vehicles.csv: Database of all vehicles in the fleet.rentals.csv: Records of all current and past rental transactions.images/: Directory for vehicle thumbnails.
This project was created for educational purposes.