It’s Thursday afternoon. You know what’s coming: the weekly report. You’ll open five dashboards, export CSVs, paste them into a spreadsheet, wrestle with pivot tables, and copy the charts into a slide deck that nobody reads. Total time: two to three hours. Every week.
I’ve been there. As a solo founder, I used to block out Friday mornings for reporting. Then I realized I was essentially a human cron job. So I wrote a script to do it for me. Now my report is waiting in my inbox at 7 AM Monday, and I haven’t touched a spreadsheet in months.
Here’s how to build your own in about 30 minutes, even if you’ve never written a line of code.
**Step 1: Pick your data sources**
Start by listing every tool that holds numbers you care about: Stripe for revenue, Google Analytics for traffic, your database for signups, maybe a project management tool for tasks completed. Most of these have APIs or at least a CSV export option.
For this example, let’s say you want weekly revenue from Stripe and weekly signups from your Postgres database. That’s a common combo for SaaS founders.
**Step 2: Choose a scripting language**
Python is the easiest for this kind of work. It has libraries for everything: `stripe` for payments, `psycopg2` for Postgres, `pandas` for data wrangling, and `matplotlib` for charts. If you prefer JavaScript, you can use Node with `axios` and `pg`. Either works.
Don’t worry about setting up a full dev environment. You can run Python scripts from your terminal with just a few packages installed. Or use a free cloud function like AWS Lambda or Google Cloud Functions to run it on a schedule.
**Step 3: Write the data-fetching code**
Here’s a minimal Python snippet to pull last week’s Stripe charges:
“`python
import stripe
from datetime import datetime, timedelta
stripe.api_key = ‘sk_test_…’
end_date = datetime.now()
start_date = end_date – timedelta(days=7)
charges = stripe.Charge.list(created={‘gte’: int(start_date.timestamp()), ‘lte’: int(end_date.timestamp())}, limit=100)
revenue = sum(charge.amount for charge in charges.auto_paging_iter()) / 100
print(f”Weekly revenue: ${revenue:.2f}”)
“`
For Postgres, you’d do something similar with a SQL query. The point is to get raw numbers into your script.
**Step 4: Format the report**
Now you have numbers. You could dump them into a plain text email, but a simple HTML table looks better. Use Python’s `tabulate` library to create a table, then embed it in an email with `smtplib` or a service like SendGrid.
If you want charts, `matplotlib` can save a PNG that you attach to the email. But honestly, a table is often enough. Don’t over-engineer.
**Step 5: Schedule it**
The final piece is automation. You don’t want to run this manually. Use `cron` on a server, or a scheduled cloud function. For example, in AWS Lambda you can set a CloudWatch Events rule to trigger your function every Monday at 6 AM.
If you’re not comfortable with cloud functions, you can use a simple service like Zapier or Make to trigger a webhook that runs your script on a platform like PythonAnywhere. But if you’re reading this, you probably want to keep it in-house.
**Step 6: Test and iterate**
Run the script manually first. Check that the numbers match what you see in the dashboards. Then schedule it and let it run for a week. You’ll likely find small issues: timezone mismatches, API rate limits, or formatting quirks. Fix them as they come.
After a month, you’ll wonder why you ever did it by hand. And you can extend the script to include more metrics, send to Slack instead of email, or even generate a PDF.
The best part? You now have a reusable template. Next time you need a report, you just tweak the queries and schedule.
If you’d rather skip the setup, our **Weekly Report Automation** script does all of this out of the box. It connects to Stripe, Postgres, and Google Analytics, and sends a formatted email every Monday. You can customize the metrics in a config file. No coding required beyond pasting your API keys.
Either way, the goal is the same: get your Fridays back. Your future self will thank you.
