This project is a robust, automated tool designed to secure high-demand gym class slots the moment registration opens.
It solves the common problem of manual booking failure by running autonomously in the background to log in, monitor the schedule, and execute bookings with guaranteed reliability.
This is a complete Backend Service Prototype. The intelligence is fully functional within the Python code, built with a clean architecture that is ready for deployment via an API.
| Feature | Non-Technical Benefit |
|---|---|
| Guaranteed Confirmation | Checks your profile page to confirm the booking was successful, so you know the result is reliable. |
| High Reliability | Handles slow websites and network lag by using robust waiting logic, ensuring the booking click always executes correctly. |
| Handles Waitlists | If a class is full, the bot automatically joins the waitlist, maximizing your chances of getting in later. |
| Secure & Private | Your login details are stored securely in a private .env file and are never committed to the codebase. |
This system is engineered for stability and professional use:
- Object-Oriented Design (OOP): The entire workflow is encapsulated within the
GymBookerclass, managing session state (self.driver,self.wait) for clean, reusable code. - Production-Grade Stability: Replaces unreliable
time.sleep()with advanced, customWebDriverWaitconditions to guarantee the application state is stable before any action is taken. - Advanced QA Verification: Implements a Set-Based Verification system to compare expected bookings against those found on the profile page, ensuring confirmation is accurate regardless of the website's class display order.
- Data Integrity: Distinguishes between a "New Booking" and an "Already Booked" class by capturing the initial button state, fixing a common logical flaw in automation.
To run this prototype locally, you need Python and the required libraries.
-
Clone the Repository:
git clone git@github.com:DonaldXoftDev/OOP-Gymbooker-automation-project.git
-
Create Virtual Environment and activate it.
-
Install Dependencies:
pip install -r requirements.txt
-
Manual Registration Prerequisite: You must first register an account on the gym website manually. The bot can only log into an existing account.
-
Secure Credentials: After registering, you will store your chosen email and password in a secure
.envfile. This file is kept local (not shared on GitHub) for your protection.- Action: Create a file named
.envin the root directory and add your login details:
EMAIL_ADDRESS="your_registered_email@example.com" APP_PASSWORD="your_gym_password" - Action: Create a file named
Update the day_time_list inside the main script to reflect your desired classes, then run:
python 'OOP Workout automation.py'