Meta description: I automated my invoicing, email follow-ups, and reporting with Python — here’s exactly how I did it and what broke along the way.

Last updated: July 10, 2026

Intro

Two years ago I was running my one-person consulting business off spreadsheets, sticky notes, and a Gmail inbox that never hit zero. I was spending close to 12 hours a week on things that had nothing to do with billable work: chasing invoices, copy-pasting client data between tools, and manually building the same weekly report every Friday night. The breaking point came when I sent an invoice with the wrong amount to a client — twice, in the same month. That’s when I decided Python automation wasn’t optional anymore; it was the only way my business could scale without me hiring an assistant I couldn’t yet afford.

TL;DR

  • I use small, single-purpose Python scripts (not a big framework) to automate invoicing, email follow-ups, and weekly reporting — each script does one job and does it well.
  • schedule, pandas, and simple cron jobs (or Windows Task Scheduler) are enough to run 90% of solopreneur automation — you don’t need Airflow or Celery.
  • The biggest gotcha: hardcoding credentials in scripts. I learned this the hard way when I accidentally committed an API key to a public repo.

Why This Matters for Solopreneurs

As a solopreneur, your time is the entire business. Every hour spent on repetitive admin work is an hour not spent on client work or growth. Unlike a company that can throw a hire at a workflow problem, you have to be your own ops department — and Python automation happens to be one of the highest-leverage skills a non-technical or semi-technical solopreneur can pick up, because most business admin tasks (emails, spreadsheets, PDFs, scheduling) map almost directly onto beginner-friendly Python libraries.

I’m not a software engineer by trade — I came from a marketing background — but within a few weekends I had scripts running that saved me real, measurable hours. That’s the promise of this approach: small scripts, not big systems.

[INTERNAL LINK: related article]

Prerequisites

Before you start, make sure you have:

  • Python 3.11+ installed (I’m running 3.12.3 as of this writing)
  • A code editor — I use VS Code with the Python extension
  • Basic comfort with the terminal (running commands, navigating folders)
  • A .env file workflow for secrets — never hardcode API keys or passwords
python3 --version
pip install python-dotenv pandas schedule requests

Security Note: Always add .env to your .gitignore before your first commit. I once pushed a Stripe test key to a public GitHub repo and had to rotate it within the hour — GitHub’s secret scanning caught it, but I shouldn’t have relied on that as a safety net.

Step-by-Step Implementation

Step 1: Automate Invoice Generation

I built a script that pulls client data from a CSV (exported from my CRM) and generates a PDF invoice using fpdf2. This alone saved me about 2 hours a week.

from fpdf import FPDF
import pandas as pd
from datetime import date

clients = pd.read_csv("clients.csv")

for _, row in clients.iterrows():
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("Helvetica", size=12)
    pdf.cell(0, 10, f"Invoice for {row['client_name']}", ln=True)
    pdf.cell(0, 10, f"Amount: ${row['amount']:.2f}", ln=True)
    pdf.cell(0, 10, f"Date: {date.today()}", ln=True)
    pdf.output(f"invoices/{row['client_name']}_{date.today()}.pdf")

Step 2: Automate Follow-Up Emails

I connected this to Gmail’s SMTP to send a follow-up email 7 days after an invoice if it hasn’t been marked paid in my tracking sheet.

import smtplib
from email.message import EmailMessage
import os
from dotenv import load_dotenv

load_dotenv()

def send_followup(client_email, client_name):
    msg = EmailMessage()
    msg["Subject"] = f"Following up on your invoice, {client_name}"
    msg["From"] = os.getenv("GMAIL_ADDRESS")
    msg["To"] = client_email
    msg.set_content(f"Hi {client_name}, just checking in on the invoice sent last week.")

    with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp:
        smtp.login(os.getenv("GMAIL_ADDRESS"), os.getenv("GMAIL_APP_PASSWORD"))
        smtp.send_message(msg)

Pro Tip: Use a Gmail App Password, not your real password — regular passwords stopped working for SMTP once Google enforced 2FA more broadly on my account, and I got an SMTPAuthenticationError: 535 until I switched to an app-specific password.

Step 3: Automate the Weekly Report

Every Friday, I used to manually pull numbers into a spreadsheet. Now a script reads my invoice CSV, computes totals, and emails me a summary.

import schedule
import time

def weekly_report():
    df = pd.read_csv("clients.csv")
    total = df["amount"].sum()
    print(f"This week's total billed: ${total:.2f}")
    # send_followup() or a summary email function goes here

schedule.every().friday.at("17:00").do(weekly_report)

while True:
    schedule.run_pending()
    time.sleep(60)

Step 4: Schedule It to Run Without You

I run these scripts via cron on a small $5/month VPS so they execute even when my laptop is closed.

crontab -e
# Add this line to run every Friday at 5 PM
0 17 * * 5 /usr/bin/python3 /home/user/scripts/weekly_report.py

Real-World Tips I Use in Production

  • I keep every script under 150 lines. If a script grows past that, I split it into modules — this has saved me hours of debugging.
  • I log every automated action to a simple text file (log.txt) so I can audit what ran and when, especially for anything that touches client communication.
  • I never let a script send an email without a manual review step for the first two weeks after deploying it — I caught a formatting bug this way before it reached a client.

Common Errors and How I Fixed Them

SMTPAuthenticationError: 535, b'5.7.8 Username and Password not accepted' — This happened because I was using my regular Gmail password. Fixed it by generating an App Password under Google Account → Security → App Passwords.

UnicodeEncodeError when generating PDFs with client names containing accentsfpdf2‘s default font doesn’t support all Unicode characters. I fixed it by embedding a Unicode-compatible font (DejaVuSans) instead of using the default Helvetica.

Cron job silently not running — Turned out my script referenced a relative path (clients.csv) that didn’t exist relative to cron’s working directory. I fixed it by using absolute paths everywhere in scheduled scripts.

[SOURCE: https://docs.python.org/3/library/smtplib.html] [SOURCE: https://schedule.readthedocs.io/en/stable/]

FAQ

Q: Do I need to know advanced Python to automate my solo business? A: No — most solopreneur automation only requires basic scripting: reading files, sending emails, and simple loops. I started with almost no formal programming background.

Q: Can I run Python automation scripts without a server? A: Yes, you can use your own computer with Task Scheduler (Windows) or cron (Mac/Linux), though a small cloud VPS ensures scripts run even when your laptop is off.

Q: What’s the cheapest way to host automation scripts as a solopreneur? A: A $5/month VPS (like a basic DigitalOcean droplet) is usually enough for lightweight scheduled scripts, and it’s far cheaper than most SaaS automation tools.

Q: Is Python better than no-code tools like Zapier for solopreneur automation? A: Python gives you more control and no per-task pricing, but no-code tools are faster to set up if you don’t want to write or maintain code — I use both depending on the task’s complexity.

Q: How do I keep API keys secure in Python automation scripts? A: Store them in a .env file loaded with python-dotenv, and always add .env to .gitignore so secrets never get committed to version control.

Conclusion

Python automation turned my Fridays from spreadsheet marathons into 20-minute check-ins. None of these scripts are complex — that’s the whole point. If you’re a solopreneur drowning in repetitive admin work, start with the one task you dread most and automate just that. I’d love to hear what you automate first — drop a comment below or share this with another solopreneur who needs it.

About the Author

I’ve spent the last 6 years running a solo consulting business while teaching myself Python to automate the parts of it I didn’t want to do manually. My stack today is Python, pandas, and a small VPS running cron jobs — no fancy infrastructure required.