This is a simple car parking service implemented in Python (with sqlite) for practical/learning purpose. It allows users to park their cars, pick them up, and view their parking history along with the associated fees.
- Park a car
- Pick up a car
- View parking history
- Clone this repository to your local machine.
- Install the required dependencies by running:
pip install -r requirements.txt
- Run the app:
python main.py
- Follow the on-screen instructions to select an option:
1: Park a car 2: Pick up a car 3: View parking history 0: Exit/Quit
When selecting option 1, you will be prompted to input the car's identity, arrival time, and frequent parking number (if any). Once entered, the car will be parked, and you will receive a confirmation message.
Option 2 allows you to pick up a parked car. You will need to input the car's identity. The service will calculate the parking fee based on the parked duration and display it. You'll be prompted to enter the payment amount, and if necessary, any available credit will be deducted. The payment history will be saved, and the car will be removed from the parking lot.
Selecting option 3 will prompt you to input the car's identity. The service will display the parking history for that car, including the total payment and available credits. Additionally, the history will be saved to a file for reference.
- The parking fee calculation is based on the duration of parking and discounts applied during different time periods.
- Payment balances are maintained for each car to track available credits.
- Parking histories are stored and can be accessed later.
- The service handles exceptions gracefully and allows for smooth interaction with the user.