This application is a desktop utility for managing and searching records in the Collyers Car Park database. It provides a graphical user interface (GUI) to search for vehicles based on owner's name, registration number, vehicle make, and model. It also allows filtering by role (student, staff, visitor).
- Search for car park records by:
- Owner's Name (first and/or last)
- Vehicle Registration Number
- Vehicle Make
- Vehicle Model
- Filter search results by role:
- All (default search)
- Student
- Staff
- Visitor
- Display search results in a table format.
- Clear search fields.
- Case-insensitive and partial search capabilities.
.
├── carpark.db # SQLite database file
├── Carpark.png # Image asset for the UI
├── carpark.ui # Qt Designer UI file
├── main.py # Main application logic
├── ui.py # Python UI class generated from carpark.ui
├── .gitignore # Git ignore file
└── __pycache__/ # Python cache directory (auto-generated)
- Python 3.x
- PyQt5
- Clone the repository (if applicable) or download the files.
- Ensure Python 3 is installed on your system.
- Install dependencies:
Open a terminal or command prompt in the project directory and run:
pip install PyQt5
- Database:
The application uses an SQLite database named
carpark.db
. This file must be present in the same directory asmain.py
. The application expects a table namedCarpark
with the following columns:registration
(TEXT)fname
(TEXT)lname
(TEXT)make
(TEXT)model
(TEXT)role
(TEXT) - e.g., 'student', 'staff', 'visitor'
- Navigate to the project directory in your terminal.
- Execute the main script:
This will launch the GUI application.
python main.py
The user interface, defined in carpark.ui
and utilized by main.py
, consists of:
- Input fields for Name, Registration, Make, and Model.
- A "Search" button to perform a general search based on the input fields.
- A "Clear" button to reset the input fields.
- Buttons to filter by "Student Cars", "Staff Cars", and "Visitor Cars". (Note: These buttons are functionally implemented in
main.py
but might need to be explicitly added to thecarpark.ui
file via Qt Designer if not already present. Thecarpark.ui
file has an empty layout namedSIDEBUTTONS
which could be used for this purpose.) - A table to display the search results.
- An image (
Carpark.png
) displayed on the UI. - A title "Collyers Car Park".
- The UI is designed using Qt Designer, and the layout is saved in
carpark.ui
. ui.py
is the Python code generated fromcarpark.ui
using thepyuic5
tool. If you make changes tocarpark.ui
with Qt Designer, you will need to regenerateui.py
by running the following command in your terminal:pyuic5 -x carpark.ui -o ui.py
- The application connects to an SQLite database named
carpark.db
. Ensure this file is correctly set up with theCarpark
table and its columns for the application to function as expected.