A Python-based command-line ride-booking application that simulates core cab-hailing functionality β from user registration and ride booking to dynamic fare calculation and trip scheduling.
- Ride Booking β Book rides by specifying pickup and drop locations through an intuitive CLI interface.
- Dynamic Fare Calculation β Fares computed based on distance, time of day, and cab type (economy/premium).
- Trip Scheduling β Schedule future rides with date/time inputs and manage upcoming bookings.
- Driver & Passenger Roles β Separate flows for passengers booking rides and drivers accepting them.
- OOP Architecture β Clean, modular design using Python classes for User, Driver, Ride, and Fare entities.
- Booking History β View past trip records per user session.
| Component | Technology |
|---|---|
| Language | Python 3 |
| Paradigm | Object-Oriented Programming (OOP) |
| Interface | Command-Line Interface (CLI) |
| Storage | In-memory / file-based |
Cab-Hailing-System/
βββ CAB/
βββ main.py # Entry point β CLI menu and app loop
βββ user.py # User and Driver class definitions
βββ ride.py # Ride booking and scheduling logic
βββ fare.py # Dynamic fare calculation engine
βββ utils.py # Helper functions
- Python 3.7+
# Clone the repository
git clone https://github.com/spinola103/Cab-Hailing-System.git
cd Cab-Hailing-System/CAB
# Run the application
python main.pyFollow the on-screen prompts to register, book a ride, or manage trips.
- Register as a passenger or driver.
- Book a ride β enter your pickup and drop-off points.
- The system calculates the fare dynamically based on distance and demand.
- Schedule a ride for a future time or get an immediate booking.
- View your trip history at any point.
Open-source. Contributions and forks welcome.