10 Python Automation Projects You Can Build This Weekend

Ten practical Python automation projects for beginners — file organiser, email reports, PDF merger, price tracker, backups and more — each with working starter code.

AD Admin PenduCoder 7 min read
10 Python Automation Projects You Can Build This Weekend
On this page

The fastest way to get good at Python is to make it do your boring work. Each project below automates a real chore — tidying files, sending reports, watching prices, backing up folders — and each one is small enough to finish in an afternoon. Together they teach you the skills employers and freelance clients actually pay for: working with files, APIs, spreadsheets, PDFs and scheduled jobs.

For every project you get what it does, the libraries you need, a working starter script and an idea to extend it.

Before you start

  • Install Python 3.11 or newer and create a virtual environment: python -m venv .venv, then activate it.
  • Install packages per project with pip install ....
  • Keep passwords and API tokens in environment variables or a .env file — never inside the script.
  • Always build a dry-run mode for scripts that move, rename or delete files.
#ProjectDifficultyYou learn
1Downloads organiserEasypathlib, shutil
2Bulk file renamerEasysorting, string formatting
3Email reportsEasysmtplib, attachments
4PDF mergerEasypypdf
5CSV to Excel reportMediumpandas, grouping
6Price trackerMediumrequests, BeautifulSoup
7Image resizerEasyPillow
8Telegram notifierEasyHTTP APIs
9Backup scriptMediumarchives, retention
10Google Sheets updaterMediumOAuth service accounts

1. Downloads folder organiser

Sorts every file in a messy folder into sub-folders such as Images, Documents and Archives based on its extension.

from pathlib import Path
import shutil

TYPES = {".pdf": "Documents", ".docx": "Documents", ".jpg": "Images",
         ".png": "Images", ".zip": "Archives", ".mp4": "Video"}

folder = Path.home() / "Downloads"
for f in folder.iterdir():
    if f.is_file():
        dest = folder / TYPES.get(f.suffix.lower(), "Other")
        dest.mkdir(exist_ok=True)
        shutil.move(str(f), str(dest / f.name))

Extend it: handle duplicate names and add a dry-run flag — the complete version is in our Downloads organiser snippet.

2. Bulk file renamer

Renames hundreds of photos or invoices to a clean pattern like invoice_001.pdf.

from pathlib import Path

folder, prefix, dry_run = Path("scans"), "invoice", True
files = sorted(p for p in folder.iterdir() if p.is_file())
for i, path in enumerate(files, start=1):
    new = path.with_name(f"{prefix}_{i:03}{path.suffix.lower()}")
    print(f"{path.name} -> {new.name}")
    if not dry_run:
        path.rename(new)

Extend it: sort by modified date, or use the photo's EXIF date in the new name.

3. Automatic email reports

Sends a file — a daily sales export, a log, a report — to your inbox or your client's.

import os, smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg["Subject"] = "Daily sales report"
msg["From"] = os.environ["SMTP_USER"]
msg["To"] = "owner@example.com"
msg.set_content("Today's report is attached.")
with open("report.xlsx", "rb") as f:
    msg.add_attachment(f.read(), maintype="application",
                       subtype="octet-stream", filename="report.xlsx")

with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp:
    smtp.login(os.environ["SMTP_USER"], os.environ["SMTP_APP_PASSWORD"])
    smtp.send_message(msg)

Note: Gmail requires an app password (with two-step verification on), not your normal password. See also our CSV clean-and-email snippet.

4. PDF merger

Combines many PDFs — receipts, chapters, scanned pages — into one file.

# pip install pypdf
from pathlib import Path
from pypdf import PdfWriter

writer = PdfWriter()
for pdf in sorted(Path("pdfs").glob("*.pdf")):
    writer.append(str(pdf))
writer.write("merged.pdf")
writer.close()

Extend it: split a PDF into pages or extract its text — see merge PDFs and extract text from PDF.

5. CSV to Excel summary report

Turns a raw CSV export into a clean Excel summary, grouped and totalled.

# pip install pandas openpyxl
import pandas as pd

df = pd.read_csv("orders.csv", parse_dates=["date"])
df = df.dropna(subset=["amount"]).drop_duplicates()
summary = (df.groupby(df["date"].dt.to_period("M").astype(str))["amount"]
             .agg(orders="count", revenue="sum").reset_index())

with pd.ExcelWriter("monthly_report.xlsx") as xl:
    summary.to_excel(xl, sheet_name="Summary", index=False)
    df.to_excel(xl, sheet_name="Raw data", index=False)

Extend it: combine with project 3 to email the report automatically every Monday.

6. Price tracker

Checks a product page and alerts you when the price drops below your target.

# pip install requests beautifulsoup4
import requests
from bs4 import BeautifulSoup

URL, TARGET = "https://example.com/product/123", 15000
html = requests.get(URL, headers={"User-Agent": "Mozilla/5.0"}, timeout=15).text
price_text = BeautifulSoup(html, "html.parser").select_one(".price").get_text()
price = float("".join(ch for ch in price_text if ch.isdigit() or ch == "."))
if price <= TARGET:
    print(f"Price dropped to {price}!")

Be responsible: check the site's terms and robots.txt, and run it a few times a day — not every minute. To watch any page for changes, use our website change monitor.

7. Image resizer and compressor

Shrinks a folder of large photos for the web, often by 70% or more.

# pip install pillow
from pathlib import Path
from PIL import Image

Path("small").mkdir(exist_ok=True)
for img in Path("photos").glob("*.jpg"):
    with Image.open(img) as im:
        im.thumbnail((1600, 1600))
        im.save(f"small/{img.stem}.webp", "WEBP", quality=80)

The full version, with EXIF rotation and transparency handling, is our bulk image resizer.

8. Telegram notifier

Sends a message to your phone when something happens — a script finishes, a server goes down, a price drops.

import os, requests

def notify(text: str) -> None:
    token, chat_id = os.environ["TG_TOKEN"], os.environ["TG_CHAT_ID"]
    requests.post(f"https://api.telegram.org/bot{token}/sendMessage",
                  data={"chat_id": chat_id, "text": text}, timeout=10)

notify("Backup finished successfully")

Create a bot with @BotFather to get the token. More detail: send a Telegram message with Python.

9. Backup script with retention

Zips a folder with a date in the name and deletes backups older than 14 days.

import shutil, time
from datetime import datetime
from pathlib import Path

SOURCE, DEST, KEEP_DAYS = Path("projects"), Path("backups"), 14
DEST.mkdir(exist_ok=True)
stamp = datetime.now().strftime("%Y-%m-%d_%H%M")
shutil.make_archive(str(DEST / f"projects_{stamp}"), "zip", SOURCE)

for old in DEST.glob("projects_*.zip"):
    if time.time() - old.stat().st_mtime > KEEP_DAYS * 86400:
        old.unlink()

Extend it: upload the zip to cloud storage, then send a Telegram message with project 8.

10. Google Sheets updater

Writes data into a Google Sheet that your team or client already uses.

# pip install gspread
import gspread
from datetime import date

gc = gspread.service_account(filename="service-account.json")
sheet = gc.open("Daily Sales").sheet1
sheet.append_row([date.today().isoformat(), 42, 128500])

Setup: create a service account in Google Cloud, enable the Sheets API, download the JSON key and share the sheet with the service account's email address.

How to schedule your scripts

An automation is only automatic when it runs without you.

# Linux / macOS: crontab -e  →  run every day at 9:00
0 9 * * * /home/you/project/.venv/bin/python /home/you/project/report.py >> /home/you/project/cron.log 2>&1

On Windows, use Task Scheduler: create a basic task, choose a trigger, and set the action to your virtual environment's python.exe with the script path as the argument. Always use full paths, and log output to a file so you can see why a run failed.

For scripts that call websites or APIs, add retries so a temporary network error does not break the run — see our retry with exponential backoff decorator.

Turn projects into skills (and income)

Small businesses pay for exactly these automations: weekly reports, invoice processing, stock alerts, data cleanup. After you build three or four, put them on GitHub with a short README and a screenshot. That portfolio is more convincing to a client than any certificate.

FAQ

Do I need to know advanced Python for these?

No. Variables, loops, functions and if statements are enough. Each project introduces one new library at a time.

Which project should I build first?

Start with project 1 or 2 — they work entirely on your own computer, need no accounts or API keys, and show results instantly.

Can I use AI to write these scripts?

Yes, but read and test every line, especially anything that deletes files or sends emails. Our guide on why fundamentals still matter explains how to use AI without being fooled by it.

Found this useful? Share it

AD

Admin PenduCoder

Full-stack developer and educator. Writes about Laravel, Next.js, applied AI and the unglamorous parts of shipping software.

Get in touch →
Chat with us