How falak097/daily-tasks-allocation-automation works
Main Components
• Environment & Configuration:
• The .env file (copied from .env.example) holds critical configuration values such as the Google Sheet URL, Gmail credentials, and email recipient details.
• Google Sheets Client:
• Represented by sheets_client.py, this component is responsible for authenticating with the Google Sheets API (using credentials.json) and fetching task data.
• Email Composition & Styling:
• email_styles.py provides the templates or styling details needed for the email content.
• Email Sending:
• This function is in email_sender.py and handles email delivery through Gmail using the configured credentials.
• Mail Scheduler:
• The mail_scheduler.py module likely automates or manages the timing of these email dispatches.
• Main Orchestrator:
• main.py ties everything together, coordinating the data retrieval, processing, email composition, and sending process.
• GitHub Prompts (under .github/prompts):
• These might provide guidance or additional configurations (for emails and scheduling) but are less central to runtime behavior—they inform development and may be used for future automation enhancements.
Relationships and Data Flow
• The system starts with the main.py script, which orchestrates the overall flow.
• main.py invokes the mail_scheduler.py to schedule the service, ensuring that tasks run at the desired intervals.
• When triggered, the scheduler uses the sheets_client.py to fetch data from Google Sheets.
• The fetched data is then handed off to email_styles.py for generating a formatted email content.
• Finally, the email_sender.py sends the email to the intended recipients using the credentials from the .env file.
• Additionally, configuration and credentials (via .env and credentials.json) impact how the Google Sheets API and Gmail services are accessed.
Important Architectural Choices
• Modularity: Each file (module) handles a distinct responsibility—fetching data, styling emails, sending emails, and scheduling. This separation promotes clarity and maintainability.
• Environment-based Configuration: Highlight that sensitive configurations are managed via the .env file and credentials.json, ensuring secure and flexible deployment.
Technologies and Tools
• Python as the main programming language.
• Google Sheets API for data retrieval.
• Gmail (with app passwords) to send emails.
• Poetry for dependency management.
• Standard modules for scheduling tasks (as implemented in mail_scheduler.py) may be based on built-in libraries or third-party scheduling modules.
Final Advice
• Remember to include any notes about external service interactions and the configuration management strategy used within the automation process.