Ahmad Tawil

Python Β· Shipped

Daily News Mailer

Sends a daily AI and tech news digest to your inbox using Python, the NewsAPI, and Gmail.

Python

A fully automated Python-based email digest that fetches, filters, formats, and sends daily AI/ML/NVIDIA news from trusted sources β€” straight to your inbox.

Built for personal use now. Designed for multi-user Flask expansion later.


πŸš€ Features #

  • βœ… Curated topic-specific news (e.g., NVIDIA, GenAI, ML Research)
  • βœ… Query + domain filtering using NewsAPI.org
  • βœ… Duplicate removal and article validation
  • βœ… Clean, modern HTML formatting
  • βœ… Secure email delivery via Gmail SMTP
  • βœ… Fully automated with daily scheduling at 7:30 AM
  • βœ… Modular architecture (fetch β†’ filter β†’ format β†’ send)

πŸ“ Project Structure #

daily-news-mailer/
β”‚
β”œβ”€β”€ main.py                  # Pipeline entry point
β”œβ”€β”€ .env                     # Secrets: API key, email credentials
β”‚
β”œβ”€β”€ news/
β”‚   β”œβ”€β”€ fetch.py             # Fetches articles per topic
β”‚   └── filter.py            # Deduplicates and filters articles
β”‚
β”œβ”€β”€ emailer/
β”‚   β”œβ”€β”€ format_html.py       # Converts articles to styled HTML
β”‚   └── send.py              # Sends HTML email securely
β”‚
β”œβ”€β”€ scheduler/
β”‚   └── job.py               # Runs `main.py` daily at 07:30
β”‚
β”œβ”€β”€ config/
β”‚   └── settings.py          # Loads environment variables
β”‚
β”œβ”€β”€ requirements.txt         # Project dependencies
└── README.md                # You're here

πŸ”§ Setup Instructions #

1. Clone the Repo #

git clone https://github.com/your-username/daily-news-mailer.git
cd daily-news-mailer

2. Create Virtual Environment #

python -m venv venv
venv\Scripts\activate   # On Windows
source venv/bin/activate  # On macOS/Linux

3. Install Dependencies #

pip install -r requirements.txt

4. Set Up .env #

NEWS_API_KEY=your_newsapi_key
EMAIL_ADDRESS=your_gmail@gmail.com
EMAIL_PASSWORD=your_16_char_app_password

⚠️ Make sure 2FA is enabled on your Gmail and you’re using an App Password.


⏰ Running the Scheduler #

python -m scheduler.job

Keeps running and waits until 07:30 every day. You can deploy it as a background job or cloud task later.


🧠 Future Goals #

As this project evolves, I plan to expand it into a full Flask-based multi-user system.

πŸ”œ Planned Features #

  • 🌐 Web interface with topic entry form (Flask)
  • πŸ‘€ User accounts + preferences storage (SQLite or Firebase)
  • 🧠 LLM-based article summarization
  • ⭐ Relevance scoring or keyword ranking with AI
  • πŸ“Š Dashboard for reading history / most-clicked articles
  • πŸ“¦ Dockerized deployment or cloud hosting (Render/Fly.io)
  • πŸ•΅οΈβ€β™‚οΈ NLP-powered duplicate detection
  • 🌍 Multilingual support (Arabic/Hebrew/English news feeds)
  • πŸ“ Daily HTML archive storage (optional)

πŸ§‘β€πŸ’» Built With #

  • Python 3.11+
  • requests + schedule + smtplib
  • dotenv for secure config
  • NewsAPI.org for real-time headlines
  • Gmail SMTP (TLS-secured)
  • Clean modular architecture (no vibe-coding)

πŸ“¬ Sample Email Preview #

"🧠 Your Daily AI Digest"
Includes 3 sections: NVIDIA, GenAI, and ML Research β€” formatted with modern HTML cards and safe links.


πŸ“„ License #

MIT License. Use freely and modify for your own use cases.


✨ Author #

Ahmad Tawil
Backend & AI-focused Software Engineer
GitHub @AhmadTawil1