Automation tool for managing ski course registrations through Google Sheets integration.
This project automates the workflow for ski course registration management by:
- Reading registration data from Google Sheets
- Processing registrations and calculating pricing
- Sending automated email notifications (registration confirmations and payment notifications)
- Updating Google Sheets with processed data
Note: This is an alpha-stage project developed for a specific use case. The domain logic could benefit from better encapsulation. Feel free to use or adapt any code for your own purposes.
- Google Sheets Integration: Reads from and writes to Google Sheets for registration management
- Automated Email Notifications: Sends customized HTML emails using Jinja2 templates
- Registration Processing: Handles registration data with custom business logic
- Price Calculation: Automated pricing based on registration details
- Cloud Function Ready: Designed to run as a Google Cloud Function triggered via AppScript HTTP requests
- Python >= 3.11
- OAuth 2.0 credentials for Google API access (both desktop and service account)
- Gmail/SMTP credentials for sending emails
-
Clone the repository:
git clone https://github.com/felixscode/gdocs_4_ski_automation.git cd gdocs_4_ski_automation -
Install dependencies:
pip install -e .Or using uv:
uv pip install -e .
-
Google API Credentials:
- Obtain OAuth 2.0 client secrets from Google Cloud Console
- Place
client_secret.jsonindata/dependencies/
-
Email Credentials:
- Set up mail service credentials
- Place
client_secret_mail.jsonindata/dependencies/ - Configure
mail_setting.yamlwith your mail settings
-
Email Templates:
- Create HTML templates for registration and payment emails
- Place templates in
data/mails/directory - Attach any required PDFs (e.g., checklist) in the same directory
-
Sheet IDs:
- Update the
sheet_idsdictionary inservice.pywith your Google Sheet IDs:settings: Settings configuration sheetregistrations: Main registrations sheetdb: Database sheet
- Update the
Run the main script directly:
python gdocs_4_ski_automation/service.pyThis service is designed to run as a Google Cloud Function. Deploy to Google Cloud Run and trigger via AppScript HTTP requests.
Deployment URL: Google Cloud Run Console
gdocs_4_ski_automation/
├── core/
│ ├── factories.py # Registration factory for building objects from sheets
│ ├── mail_services.py # Email sending and processing logic
│ ├── sheet_dumper.py # Writing processed data back to sheets
│ ├── price_calculation.py # Pricing logic for registrations
│ └── ctypes.py # Custom types and data structures
├── utils/
│ └── utils.py # Google API authentication utilities
└── service.py # Main entry point and orchestration
data/
├── dependencies/ # Credentials and configuration files
└── mails/ # Email templates and attachments
gspread: Google Sheets API integrationpandas: Data processingopenpyxl: Excel file handlingjinja2: Email template renderingpyyaml: Configuration file parsingyagmail: Email sending
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.
Felix Schelling - felix.schelling@protonmail.com