A full-featured hotel booking application built with Python and Streamlit.
Browse hotels, validate payment cards, add spa upgrades, and receive a
generated PDF reservation ticket — all in one polished dark UI.
- 🏩 Hotel Cards: Each hotel displays name, city, rating, price per night, amenities, and availability status in a glassmorphism card.
- 💳 Card Validation: Credit card details (number, expiry, holder, CVC) are validated against a CSV dataset before any booking is confirmed.
- 🔐 2-Step Authentication:
SecureCreditCardadds a password check on top of standard validation — no booking without both passing. - 🧖 Spa Upgrade: Eligible hotels offer an optional VIP Spa add-on, handled via the
SpaHotelsubclass. - 📄 PDF Ticket Generation: A formatted A4 reservation statement is generated with
fpdf2and offered as a download after booking. - 🎨 Premium Dark UI: Animated gradient background, glassmorphism cards, hover effects — all injected via
styles.py.
The app is split into focused classes, keeping business logic separate from the UI layer.
SpaHotel extends Hotel with spa booking functionality — demonstrating OOP inheritance cleanly:
class SpaHotel(Hotel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.spa_included = False
def book_spa(self):
self.spa_included = TrueStandard card data is validated against cards.csv. The secure subclass adds a password layer checked against card-security.csv:
class SecureCreditCard(CreditCard):
def authenticate(self, given_password, df_security_dict):
if self.number in df_security_dict:
return df_security_dict[self.number] == given_password
return FalseBaseTicket is an ABC that handles all PDF layout logic. ReservationTicket only needs to implement generate_text() — keeping the PDF generation reusable:
class BaseTicket(ABC):
@abstractmethod
def generate_text(self) -> str:
pass
def generate_pdf(self, filename="ticket.pdf"):
# Full A4 PDF layout with header, table, totals, footer...Hotel-Booking/
├── data/
│ ├── hotels.csv # Hotel data — name, city, price, rating, amenities
│ ├── cards.csv # Valid card data for payment validation
│ └── card-security.csv # Card passwords for 2-step authentication
├── modules/
│ ├── __init__.py
│ ├── hotel.py # Hotel & SpaHotel classes
│ ├── payment.py # CreditCard & SecureCreditCard classes
│ └── ticket.py # BaseTicket (ABC) & ReservationTicket
├── utils/
│ ├── __init__.py
│ └── styles.py # Injected CSS — dark theme & glassmorphism
├── main.py # Streamlit UI & booking flow
├── requirements.txt
└── README.md
-
Clone the repository:
git clone https://github.com/AndrewTechTips/Luxury-Booking-Engine.git cd Luxury-Booking-Engine -
Install dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run main.py
- LinkedIn: Andrei Condrea
- Email: condrea.andrey777@gmail.com
"Thank you for choosing absolute excellence. Enjoy your travels." 🌍