DEV Community

Brad
Brad

Posted on

5 Python Scripts That Run My Entire Freelance Business (Saving $400/yr)

Running a freelance business means admin work. Here are 5 Python scripts that replaced $400/year in SaaS tools for me.

1. Invoice Generator (replaces FreshBooks $17/mo)

from fpdf import FPDF
from datetime import datetime

def generate_invoice(client_name, service, hours, rate):
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("Arial", "B", 16)
    pdf.cell(0, 10, "INVOICE", ln=True, align="C")
    pdf.set_font("Arial", "", 12)
    pdf.cell(0, 10, f"Client: {client_name}", ln=True)
    pdf.cell(0, 10, f"Total: ${hours * rate:.2f}", ln=True)
    pdf.output(f"invoice_{client_name}.pdf")
Enter fullscreen mode Exit fullscreen mode

2. Client Update Email (replaces Mailchimp $13/mo)

import smtplib
from email.mime.text import MIMEText

def send_update(client_email, project, progress):
    msg = MIMEText(f"Project {project}: {progress}% complete.")
    msg["Subject"] = f"{project} Progress Update"
    msg["To"] = client_email
    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as s:
        s.login("you@email.com", "password")
        s.send_message(msg)
Enter fullscreen mode Exit fullscreen mode

3. Time Tracker (replaces Toggl $10/mo)

import json
from datetime import datetime
from pathlib import Path

def log_work(project, hours, rate=75):
    log = Path("time_log.json")
    data = json.loads(log.read_text()) if log.exists() else []
    data.append({"project": project, "hours": hours, "revenue": hours*rate, "date": str(datetime.now().date())})
    log.write_text(json.dumps(data))
    return hours * rate
Enter fullscreen mode Exit fullscreen mode

4. Proposal Generator (replaces PandaDoc $25/mo)

def create_proposal(client, project, hours, rate=75):
    total = hours * rate
    with open(f"proposal_{client}.md", "w") as f:
        f.write(f"# Proposal for {client}
")
        f.write(f"## {project}
")
        f.write(f"- Hours: {hours}
")
        f.write(f"- Rate: ${rate}/hr
")
        f.write(f"- Total: ${total}
")
    print(f"Proposal: ${total}")
Enter fullscreen mode Exit fullscreen mode

5. Revenue Dashboard (free vs BI tools)

import json
from pathlib import Path

def weekly_summary():
    data = json.loads(Path("time_log.json").read_text())
    total = sum(d["revenue"] for d in data[-7:])
    print(f"This week: ${total}")
    print(f"Monthly estimate: ${total * 4:.0f}")
Enter fullscreen mode Exit fullscreen mode

I packaged these + 45 more scripts into the Python Business Automation Toolkit for $9 one-time.

What admin task eats most of your time? Comment below!

Top comments (0)