A professional collection of Python automation scripts designed to streamline repetitive tasks. Features robust error handling, comprehensive logging, and easy configuration management.
✅ File Organizer - Automatically categorizes and sorts files by type
✅ Email Automation - Send bulk emails with attachments
✅ Web Scraper - Extract data from websites and save to CSV
✅ Error Handling - Comprehensive try-catch blocks
✅ Logging - Detailed operational logs for debugging
✅ Environment Configuration - Use .env files for sensitive data
Senjar-Automation-Scripts/
├── scripts/
│ ├── file_organizer.py # File organization utility
│ ├── auto_email.py # Email automation tool
│ └── web_scraper.py # Web scraping utility
├── examples/ # Example outputs
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
├── README.md # This file
└── LICENSE # MIT License
-
Clone the repository:
git clone https://github.com/senjarahmad/Senjar-Automation-Scripts.git cd Senjar-Automation-Scripts -
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
cp .env.example .env # Edit .env with your settings
Automatically sort files into folders by type (Images, Documents, Videos, etc.).
python scripts/file_organizer.pyConfiguration: Edit ORGANIZE_FOLDER in the script or set ORGANIZE_FOLDER environment variable.
Send emails to multiple recipients with attachments.
python scripts/auto_email.pySetup:
- Set
SENDER_EMAILandSENDER_PASSWORDin.env - For Gmail, use App Passwords
- Update recipient list and email content in the script
Scrape website content and save to CSV.
python scripts/web_scraper.pyOutput: Generates timestamped CSV files in the examples/ directory
Purpose: Organize downloads and desktop files into categorized folders
Improvements:
- Handles duplicate filenames automatically
- Comprehensive error logging
- Skips directories (only processes files)
- Support for 50+ file types
Purpose: Send bulk emails with attachments
Security Features:
- Uses environment variables (not hardcoded credentials)
- OAuth-ready structure
- Proper error handling for authentication failures
Class-based Design:
EmailSenderclass for reusable email functionality- Supports both single and bulk email sending
Purpose: Extract article data from websites
Features:
- Custom user-agent headers
- Request timeout handling
- Absolute URL conversion
- Timestamped CSV output
- Error resilience
beautifulsoup4- Web scrapingrequests- HTTP requestspython-dotenv- Environment variable management
See requirements.txt for exact versions.
# Email Configuration
SENDER_EMAIL=your_email@gmail.com
SENDER_PASSWORD=your_app_password
# File Organizer
ORGANIZE_FOLDER=./Downloads
# Web Scraper
SCRAPE_URL=https://news.ycombinator.com/- Type hints for better IDE support
- Comprehensive docstrings
- PEP 8 compliant
- Error handling at every step
- Logging for debugging
✅ Error handling with try-except blocks
✅ Logging instead of print statements
✅ Configuration through environment variables
✅ Type hints for better code clarity
✅ Docstrings for all functions
✅ Duplicate file handling
✅ Class-based architecture
✅ Resource cleanup (context managers)
- Never commit
.envfiles with real credentials - Use app passwords for Gmail (not your main password)
- Keep dependencies updated:
pip install --upgrade -r requirements.txt
- File Organizer: Handles 1000+ files efficiently
- Email Sender: Rate-limited to avoid blocking
- Web Scraper: Includes timeouts to prevent hanging
MIT License - See LICENSE file for details
Junayead Ahmad Senjar (@senjarahmad)
Full-Stack Developer | Automation Enthusiast
Fork this repository and submit pull requests for improvements.
For issues and questions, please create a GitHub issue.
Last Updated: January 2026
Status: Active Development