NewsWire is a Python Command-Line Interface (CLI) application based on Object-Oriented Programming (OOP) principles. It sends personalized news alerts via email to recipients based on their specified interests. The application keeps running and performs the task weekly every Monday at 10:00 AM, broadcasting emails with 10 news articles about each topic/interest during the passing week.
- Email News Alerts: Sends personalized email news alerts to recipients based on their specified interests.
- Customizable Interests: Allows users to specify their interests, and the system fetches news articles accordingly.
- Scheduled Task: Automatically sends email alerts on a weekly basis every Monday at 10 AM.
- Continuous Operation: The application keeps running to ensure timely execution of scheduled tasks.
- Scalable Contact Management: Users are free to expand the
contacts.xlsxfile to add contacts with emails and interests, and the app will broadcast emails with 10 news articles about each topic/interest during the passing week. - Logging: Utilizes logging to record detailed information about the application's execution, including errors, warnings, and informational messages.
- openpyxl: A library for reading and writing Excel files.
- python-dotenv: A library for managing environment variables in .env files.
- requests: A library for making HTTP requests.
- schedule: A library for job scheduling.
- yagmail: A library for sending emails using Gmail.
- logging: A module for tracking events that happen when software runs.
- datetime: A module for manipulating dates and times.
The application utilizes the News API to fetch news articles based on specified interests.
- Clone the repository.
- Ensure Python 3.x is installed.
- Install the required dependencies using
pip install -r requirements.txt. - Configure the necessary parameters such as API keys and email credentials in
config.py.- Set up environment variables for
NEWS_API_KEY,SENDER, andPASSWORD.
- Set up environment variables for
- Prepare a list of contacts with their names, email addresses, interests, and preferred languages in an Excel file and save it as
contacts.xlsxin theresourcesdirectory. - Run the script using
python main.py.
- Run the script using
python main.py. - The script will automatically send personalized email news alerts to the recipients listed in the
contacts.xlsxfile at 10:00 AM every Monday. - Ensure that the email credentials provided in the
config.pyfile are valid and have permission to send emails.
Note: During development, disposable email addresses from online services were used for testing purposes.
Contributions are welcome! Here are some ways you can contribute to the project:
- Report bugs and issues
- Suggest new features or improvements
- Submit pull requests with bug fixes or enhancements
This project is licensed under the MIT License, which grants permission for free use, modification, distribution, and sublicense of the code, provided that the copyright notice (attributed to emads22) and permission notice are included in all copies or substantial portions of the software. This license is permissive and allows users to utilize the code for both commercial and non-commercial purposes.
Please see the LICENSE file for more details.
