Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌅 Morning Briefing

Python Status License

Morning Briefing is a Python-based daily digest that collects weather, news, motivational quotes, and a morning song, then sends it directly to your email (or Telegram).

The project fetches data from public APIs, formats it nicely, and delivers it automatically — a little helper to start your day informed and motivated.


⚡ Features

  • 🌤️ Weather: Current weather, temperature, min/max.
  • 📰 News: Top headline from News API.
  • 💬 Quote: Random motivational quote.
  • 🎶 Song: Random jazz track from Last.fm.
  • 📩 Delivery: Sends a nicely formatted message to your email.

🛠️ Project Structure

app/
├─ api_client.py     # fetch_data functions
├─ config.py         # API keys, coordinates
├─ formatter.py      # format responses to readable text
├─ messenger.py      # email/Telegram sending
main.py              # main entry point
.env                 # environment variables (API keys, email)
requirements.txt     # Python dependencies

⚙️ Installation

  1. Clone the repo:
git clone https://github.com/yourusername/morning-briefing.git
cd morning-briefing
  1. Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate   # Linux/Mac
.venv\Scripts\activate      # Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Add your .env file with API keys and email credentials:
EMAIL=your_email@gmail.com
PASS=your_email_password
LAT=42.15
LON=24.75
WEATHER_API=your_openweather_api_key
NEWS_API=your_newsdata_api_key
MUSIC_API=your_lastfm_api_key

🚀 Usage

Run the main script:

python main.py

The script will fetch data from all sources, format it, and send it to the configured email address.

You can schedule it using cron (Linux/Mac) or Task Scheduler (Windows) to run automatically every morning.


🧪 Testing

Tests are written with pytest. Run them with:

pytest -v

Lint your code with flake8:

flake8 app tests --max-line-length=100 --ignore=E203,W503

📦 Docker (Optional)

You can containerize the app with Docker for easier deployment. Create a Dockerfile and docker-compose.yml to run the app with all dependencies preinstalled.


📜 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages