Reviewed-on: #1
Crossfit Application
This is a Python application for managing Crossfit bookings and notifications. The application automates the process of booking Crossfit sessions and sends notifications via email and Telegram when a booking is successful.
Features
- Automated booking of Crossfit sessions
- Email and Telegram notifications for successful bookings
- Configurable preferred sessions
- Retry logic for booking failures
- Detailed logging
Prerequisites
- Docker
- Docker Compose
Setup
- Create a
.envfile based on.env.exampleand fill in the required credentials. - Build and run the application using Docker Compose:
docker-compose up --build
- The application will run in a Docker container, and the logs will be stored in the
./logdirectory.
Usage
The application will automatically check for available sessions and book them based on your preferences. It will send notifications via email and Telegram when a booking is successful.
Environment Variables
The following environment variables are required:
CROSSFIT_USERNAME: Your Crossfit usernameCROSSFIT_PASSWORD: Your Crossfit passwordEMAIL_FROM: Your email addressEMAIL_TO: Recipient email addressEMAIL_PASSWORD: Your email passwordTELEGRAM_TOKEN: Your Telegram bot tokenTELEGRAM_CHAT_ID: Your Telegram chat ID
Preferred Sessions
You can configure your preferred sessions in the crossfit_booker.py file. The preferred sessions are defined as a list of tuples, where each tuple contains the day of the week, start time, and session name.
PREFERRED_SESSIONS = [
(4, "17:00", "WEIGHTLIFTING"), # Friday 17:00 WEIGHTLIFTING
(5, "12:30", "HYROX"), # Saturday 12:30 HYROX
(2, "18:30", "CONDITIONING"), # Wednesday 18:30 CONDITIONING
]
Files
Dockerfile: Docker image definitiondocker-compose.yml: Docker Compose service definition.env.example: Example environment variables file.dockerignore: Docker ignore file.gitignore: Git ignore filebook_crossfit.py: Main application scriptcrossfit_booker.py: Crossfit booking scriptsession_notifier.py: Session notification scriptrequirements.txt: Python dependencies
Project Structure
.
├── Dockerfile
├── docker-compose.yml
├── .env.example
├── .dockerignore
├── .gitignore
├── book_crossfit.py
├── crossfit_booker.py
├── session_notifier.py
├── requirements.txt
└── log
└── crossfit_booking.log
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.