Skip to content

dariomory/klm-booking-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Airline Booking System

Table of Contents

Overview

This project implements a simple airline booking management system for KLM in Python. It includes functionalities to add bookings and query them based on departure times and routes.

Features

  • Add new flight bookings.
  • Retrieve bookings departing before a specified time.
  • Retrieve bookings for a specific route (origin to destination).

Prerequisites

  • Python 3.10 or higher

Setup

  1. Clone the repository
  2. Navigate to the project directory
  3. Run the project using Python (there are no third party libraries)
git clone https://github.com/dariomory/klm-booking-system.git
cd klm-booking-system
python main.py

Tests

Run the tests using the following command:

python3 -m unittest discover tests

Usage

To use the BookingManager, create an instance of the BookingManager class and use its methods to manage bookings.

See also: demo.py

Creating Itineraries

from klm_booking_system import Itinerary

itinerary = Itinerary(["AMS", "LHR", "JFK"])

Making a Booking

from klm_booking_system import Booking
from datetime import datetime

booking = Booking(datetime(2023, 5, 26, 6, 45), itinerary)

Managing Bookings

from klm_booking_system import BookingManager

manager = BookingManager()
manager.add_booking(booking)

Querying Bookings

bookings_before_date = manager.bookings_before(datetime(2023, 6, 1))
bookings_on_route = manager.bookings_for_route("AMS", "LHR")

About

A simple airline booking management system for KLM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages