Read more

 

10 Python Scripts That Save You Hours Every Week

Let’s be honest—we all have those annoying, repetitive tasks that eat up our time: renaming files, cleaning spreadsheets, copying data, checking emails, you name it. The good news? Python is here to automate your digital life.

Whether you're a freelancer, marketer, student, or small business owner—these 10 simple Python scripts can save you hours every single week. No complex AI needed. Just clean, practical automation.


⏱️ 1. Rename Hundreds of Files in Seconds

Use case: Got a folder full of badly named images or PDFs?

python
import os folder = 'my_folder' for count, filename in enumerate(os.listdir(folder), start=1): ext = os.path.splitext(filename)[1] new_name = f'document_{count}{ext}' os.rename(os.path.join(folder, filename), os.path.join(folder, new_name))

Why it helps: Stop manually renaming files one by one.


📂 2. Organize Files Into Folders Automatically

Use case: Dump folder? Automatically sort files by type.

python
import os import shutil source = "downloads" dest_map = { "Images": [".png", ".jpg"], "Docs": [".pdf", ".docx"], "Videos": [".mp4", ".mov"] } for file in os.listdir(source): ext = os.path.splitext(file)[1].lower() for folder, extensions in dest_map.items(): if ext in extensions: shutil.move(os.path.join(source, file), os.path.join(source, folder, file))

Why it helps: Turns a digital mess into a neat workspace.


📊 3. Clean Excel Data in One Click

Use case: Tired of deleting empty rows and fixing dates manually?

python
import pandas as pd df = pd.read_excel("sales.xlsx") df.dropna(inplace=True) df['Date'] = pd.to_datetime(df['Date']) df.to_excel("cleaned_sales.xlsx", index=False)

Why it helps: Clean messy Excel sheets in seconds.


📧 4. Send Automated Emails with Attachments

Use case: Weekly reports or follow-ups?

python
import smtplib from email.message import EmailMessage msg = EmailMessage() msg["Subject"] = "Weekly Report" msg["From"] = "you@example.com" msg["To"] = "client@example.com" msg.set_content("Hi! Please find the report attached.") with open("report.pdf", "rb") as f: msg.add_attachment(f.read(), maintype='application', subtype='pdf', filename="report.pdf") with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp: smtp.login("you@example.com", "your_password") smtp.send_message(msg)

Why it helps: Send bulk or routine emails like a boss.


🌐 5. Scrape Website Data into Excel

Use case: Pull product prices, job listings, or contact info.

python
import requests from bs4 import BeautifulSoup import pandas as pd url = 'https://example.com/products' page = requests.get(url) soup = BeautifulSoup(page.text, 'html.parser') products = [(item.text, item['href']) for item in soup.select('.product-title a')] df = pd.DataFrame(products, columns=["Title", "Link"]) df.to_excel("products.xlsx", index=False)

Why it helps: Say goodbye to copy-paste scraping.


🧼 6. Remove Duplicates From CSVs

python
df = pd.read_csv("data.csv") df.drop_duplicates(inplace=True) df.to_csv("deduped_data.csv", index=False)

Why it helps: Instantly cleans up CRM or form data exports.


📝 7. Convert PDF to Text

Use case: Extract content from resumes, invoices, etc.

python
import PyPDF2 with open('file.pdf', 'rb') as f: reader = PyPDF2.PdfReader(f) text = ''.join([page.extract_text() for page in reader.pages]) with open('output.txt', 'w') as out: out.write(text)

Why it helps: Turn uneditable PDFs into searchable content.


⏲️ 8. Automate Time Tracking

Use case: Freelancers or remote workers logging hours.

python
import time start = time.time() input("Press Enter when you stop working...") end = time.time() hours = round((end - start) / 3600, 2) print(f"You worked for {hours} hours.")

Why it helps: Track productivity without fancy tools.


📅 9. Create Calendar Events Automatically

python
from datetime import datetime import csv with open('meetings.csv') as f: for row in csv.DictReader(f): print(f"Scheduled meeting with {row['Name']} at {row['DateTime']}") # You can integrate with Google Calendar API here

Why it helps: Automate recurring event setups.


🔄 10. Bulk Convert Images (e.g., JPG to PNG)

python
from PIL import Image import os for file in os.listdir('images'): if file.endswith(".jpg"): img = Image.open(os.path.join('images', file)) img.save(os.path.join('images', file.replace(".jpg", ".png")))

Why it helps: Perfect for designers, photographers, or marketers.


👩‍💻 Final Thoughts: Code Once, Save Forever

The beauty of Python isn’t in building billion-dollar apps—sometimes, it's just about taking back your time. These scripts are like little digital assistants: reliable, fast, and never asking for a raise.

So next time you find yourself doing the same thing for the third time in a row—pause, and ask yourself:

Can Python do this for me?
Spoiler: It probably can.

 

Related Courses 

Python 6 Projects – Basic to Advanced Python Programming 

Odoo Application Developer (Python Framework)

PHP Programming (for Beginner)

0 Reviews

Contact form

Name

Email *

Message *