Home Services About Team Blog Contact Let's Talk FR
Automation

Python Automation: 10 Scripts Every Business Should Have

10 essential Python automation scripts: email automation, report generation, data processing, and more time-savers.

Python has become the default language of business automation for a simple reason: it connects to everything, it reads like English, and the ecosystem has a library for almost any system you touch. Below are the ten automations I build most often for clients — each one small, focused and independently valuable. Together they form a starter kit that pays for itself in weeks.

Why Python?

Automation lives or dies on integrations. Python talks to Excel files (openpyxl), email (imaplib/smtplib), databases (SQLAlchemy), APIs (requests), PDFs, SFTP servers and browsers (Playwright, Selenium) — usually with a few lines each. And because the code is readable, the person maintaining it in two years doesn't need to be the person who wrote it.

The 10 scripts

1. The email sorter

Connects to your inbox, classifies incoming mail by rules (sender, subject, attachment type), moves messages to folders, and extracts attachments into dated directories. Overnight, your inbox becomes a structured queue instead of a swamp.

2. The report generator

Pulls numbers from your sources, computes metrics and produces a formatted Excel or PDF report — on schedule, before anyone asks for it.

# every Monday 07:00 — crontab: 0 7 * * 1
data = fetch_from_sources()
df = pd.DataFrame(data).pipe(clean).pipe(add_kpis)
save_report(df, f"weekly_{monday:%Y%m%d}.xlsx")
email.send(to=MANAGERS, attachment=last_report())

3. The backup verifier

Backups nobody tested are not backups. This script copies critical files (or dumps databases) to a second location, verifies checksums, and alerts you when the last good backup is older than your tolerance.

4. The price / stock monitor

Checks supplier or competitor pages you're permitted to access, records changes to a small database, and emails a diff when something moves beyond a threshold. Decisions get made on data, not on someone remembering to check.

5. The invoice reminder

Reads your invoicing export, finds overdue invoices by aging bucket, and sends polite, pre-written reminder emails with escalation levels. Cash flow improves without a single awkward phone call.

6. The data cleaner

Every company has "that spreadsheet". This script normalizes names, deduplicates rows, fixes dates and validates formats — producing a clean dataset others can finally trust.

df = (df
  .assign(email=df.email.str.strip().str.lower())
  .drop_duplicates(subset=["email"])
  .query("email.str.contains('@')")
)
df.to_csv("customers_clean.csv", index=False)

7. The form-to-CRM bridge

Website form submissions (from any form backend with a webhook or export) flow automatically into your CRM with validation and de-duplication — no more manual retyping of leads.

8. The screenshot / archive bot

Periodically captures screenshots or PDF snapshots of key pages — dashboards, supplier portals, your own site — building a dated archive that becomes invaluable during disputes or audits.

9. The file organizer

Watches a "drop zone" folder and routes files by pattern: invoices to accounting, CVs to HR, photos to the media library, renamed and dated. Shared drives stop being landfills.

10. The health checker

Pings your websites, APIs and services on a schedule, measures response times, and alerts you when something is down or slow — before your customers tell you.

for service in SERVICES:
    t0 = time.perf_counter()
    r = requests.get(service.url, timeout=10)
    ms = (time.perf_counter() - t0) * 1000
    log.info("%-20s %s %6.0fms", service.name, r.status_code, ms)
    if r.status_code != 200:
        alert.send(f"{service.name} DOWN ({r.status_code})")

Running them reliably

  • Schedule with cron or Task Scheduler — a script that requires a human to click "run" is not an automation.
  • Log everything to a file; when something breaks at 3 AM, the log is your only witness.
  • Fail loudly: wrap each run and send an email on any exception. Silent failures are worse than no automation.
  • Keep secrets in a .env file — never hardcode passwords in scripts that end up in a shared folder.
  • Version them in git like any other code.

Build or buy?

Off-the-shelf tools cover some of these jobs — but they stop exactly where your business logic starts. A script is yours: it implements your rules, connects your systems, and costs nothing per execution. My rule: if a process is standard, buy; if it's yours, build.

A realistic rollout plan

Trying to deploy all ten at once fails the way New Year's resolutions fail. The plan that works:

  1. Week 1 — inventory. List every recurring manual task with frequency and minutes. You'll find candidates nobody mentioned in meetings.
  2. Week 2 — pick the top two by ROI (usually the email sorter or the report generator). Build, test with real data, run in "shadow mode" alongside the human process for one week.
  3. Week 3 — go live with a watchdog. The script runs; a human reviews its output for five minutes daily instead of doing the work. Every anomaly gets fixed once, permanently.
  4. Week 4+ — expand. Each additional script reuses the logging, alerting and scheduling foundation of the first ones, so every next automation costs less than the last.

Within a quarter, the compounding effect is real: not just hours saved, but a culture shift — people start proposing automations because they've seen them work.

Key takeaways

  • Start with the pain that repeats most often — email and reports are usually first.
  • Every script needs logging, alerting and scheduling from day one.
  • Ten small scripts beat one giant one: easy to test, easy to fix, easy to explain.
Want any of these built for your business? Contact me — tell me which number from the list hurts most.
Views are counted anonymously on the server — one per visitor every 30 minutes, no tracking.
Omar Kasmi
Omar KasmiPython Developer · Certified Penetration Tester · Data Engineer
More About Me