- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
Terminal Email Reader: A Python Automation Project
Introduction
As a student balancing classes, freelance work, and personal tasks, I wanted a way to check my Gmail quickly—without leaving the terminal. So I built a Python script that fetches unread emails and displays them right in the command line, showing the sender, subject, and body.
Thanks to Amazon Q Developer CLI, I streamlined the development process by asking coding questions directly in my terminal. This is my submission for the "Crushing the Command Line" prompt of the Amazon Q Developer "Quack The Code" Challenge.
What My Project Does
This script:
Amazon Q Developer CLI acted like a coding assistant:
Without Q Developer, I’d have spent hours Googling—instead, I got answers right in my terminal.
What I Learned
git clone
cd email-automation
EMAIL=your-email@gmail.com
PASSWORD=your-app-password # Generate this in Gmail settings
Note: Never commit .env to version control.
pip install -r requirements.txt
python email_automation.py
Note: Enable IMAP in Gmail settings and create an App Password if you use 2FA.
GitHub Repository
Final Thoughts
This project taught me how powerful command-line automation can be—and how tools like Amazon Q Developer make coding faster and more intuitive. Next, I’d love to add features like email filtering or mark-as-read functionality.
Thanks for reading! Feedback is welcome.
Introduction
As a student balancing classes, freelance work, and personal tasks, I wanted a way to check my Gmail quickly—without leaving the terminal. So I built a Python script that fetches unread emails and displays them right in the command line, showing the sender, subject, and body.
Thanks to Amazon Q Developer CLI, I streamlined the development process by asking coding questions directly in my terminal. This is my submission for the "Crushing the Command Line" prompt of the Amazon Q Developer "Quack The Code" Challenge.
What My Project Does
This script:
- Logs into Gmail using IMAP with credentials stored securely in a .env file
- Fetches and decodes unread emails
- Prints cleanly formatted output (sender, subject, and body) in the terminal
- Uses .gitignore to exclude sensitive files (like .env)
Amazon Q Developer CLI acted like a coding assistant:
- Security Setup: Asked how to manage .env files safely in Python projects.
- IMAP Debugging: Helped troubleshoot email-fetching logic and MIME decoding.
- Code Simplification: Suggested improvements to reduce complexity and improve readability.
Without Q Developer, I’d have spent hours Googling—instead, I got answers right in my terminal.
What I Learned
- How to use IMAP to access Gmail programmatically
- Securing credentials with python-dotenv and .gitignore
- Decoding MIME email formats (especially tricky with Gmail’s encoding)
- How powerful Amazon Q Developer is for real-time debugging and learning
- Clone the repo:
git clone
cd email-automation
- Set up your .env file:
EMAIL=your-email@gmail.com
PASSWORD=your-app-password # Generate this in Gmail settings
Note: Never commit .env to version control.
- Install dependencies:
pip install -r requirements.txt
- Run it:
python email_automation.py
Note: Enable IMAP in Gmail settings and create an App Password if you use 2FA.
GitHub Repository
Final Thoughts
This project taught me how powerful command-line automation can be—and how tools like Amazon Q Developer make coding faster and more intuitive. Next, I’d love to add features like email filtering or mark-as-read functionality.
Thanks for reading! Feedback is welcome.