Free reporting: automate your weekly Excel report with Python
Author: Atalay Deveci · Published 12 October 2026 · 3 min read
▶ Short answer
You can automate a weekly Excel report for free with Python and the open-source pandas library. About 25 lines of code read the export, clean it, summarize it and write a new workbook, and your operating system's scheduler runs it every week. It works well for a handful of reports from one source; beyond that you need a single source of truth.
First, put a number on the manual work
Before automating, find out what the manual reports actually cost. Multiply the hours per report by the people involved and by how often it repeats, then by a fully loaded hourly cost. The Manual Reporting Cost tool does this in your browser in two minutes.
Annual hours = Σ (hours per report × people × repeats per year)
- Hours per report: time to prepare it once
- People: how many contribute
- Repeats per year: 52 for weekly, 12 for monthly
What you need (all free)
| Tool | What it does | Cost |
|---|---|---|
| Python 3 | Runs the code | Free, open source |
| pandas | Reads, cleans and summarizes tables [1] | Free, open source |
| openpyxl | Lets pandas read and write .xlsx files [4] | Free, open source |
| Task Scheduler or cron | Runs the script every week [5][6] | Built into the operating system |
After installing Python, run pip install pandas openpyxl once in a terminal.
The 25-line report
The example uses a weekly sales export with Date, Region, Product, Units and Revenue columns. The goal is a workbook with monthly revenue by region and the top 10 products. Rename the columns to match your own export.
import pandas as pd
# 1) Read
df = pd.read_excel("sales.xlsx")
# CSV instead: df = pd.read_csv("sales.csv")
# 2) Clean
df["Date"] = pd.to_datetime(df["Date"])
df = df.dropna(subset=["Revenue"]).drop_duplicates()
# 3) Summarize
df["Month"] = df["Date"].dt.to_period("M").astype(str)
by_region = df.pivot_table(index="Region", columns="Month", values="Revenue", aggfunc="sum", fill_value=0)
top10 = (
df.groupby("Product", as_index=False)["Revenue"].sum()
.sort_values("Revenue", ascending=False)
.head(10)
)
# 4) Write
with pd.ExcelWriter("weekly_report.xlsx") as writer:
by_region.to_excel(writer, sheet_name="Region x Month")
top10.to_excel(writer, sheet_name="Top 10 products", index=False)Read
read_excel loads the workbook into a table (a DataFrame) [2]; read_csv does the same for CSV files and lets you set the separator, decimal mark and encoding when an older system exports something unusual [3].
Clean
Parse dates, drop rows without revenue and remove exact duplicates. Real data needs more: the same customer spelled three ways, mixed units, gaps in the history. Run your file through the free Data Quality Check to see what's there; it runs entirely in your browser.
Summarize
pivot_table is the pandas version of an Excel PivotTable: regions in rows, months in columns, summed revenue in the cells [1]. groupby totals revenue per product, which is then sorted and cut to the top 10.
Write
ExcelWriter puts both tables on separate sheets of one workbook [4]. The report now comes out identical, and without copy-paste errors, every time it runs.
Run it every week automatically
- Windows: create a task in Task Scheduler that runs
python report.pyevery Monday at 08:00 [5]. - Linux and macOS: add
0 8 * * 1 python3 /path/report.pyto your crontab; it runs the script every Monday at 08:00 [6].
When a script stops being enough
| Situation | A script is enough | You need infrastructure |
|---|---|---|
| Number of reports | 1–3 | Dozens |
| Data sources | One export | ERP, CRM, e-commerce and spreadsheets together |
| Do the numbers agree? | Yes | Departments see different figures |
| Who maintains it? | The person who wrote it | It shouldn't depend on one person |
Once reports multiply and pull from several systems, the problem moves from code to data infrastructure: every report should read from one single source of truth with one definition per metric. That is the core of my reporting automation work, and the natural next step is a custom dashboard on top of it.
▶ Questions and answers
Is there really a free way to automate reporting?
Yes. Python, pandas and openpyxl are open source and free, including for commercial use, and every major operating system has a built-in scheduler. Your only cost is the time to set it up.
Do I need to be a programmer?
No. If you're comfortable with Excel formulas and PivotTables, the pandas basics take a few weeks to learn.
Can the script email the report as well?
Yes. Python's standard library can send email, or the file can be saved to a shared folder that everyone already uses. Saving to a shared folder is usually simpler and safer.
Why not just use Power BI or Excel macros?
You can. Python is free, works with version control, and the same code serves both analysis and automation. If you later want a visual dashboard, the data prepared in Python can feed it.
▶ Concepts
Linked to Wikipedia and Wikidata.
▶ Sources
- [1]pandas, pandas.pivot_table — API reference, 2026. pandas.pydata.org/docs/reference/api/pandas.pivot_table.html
- [2]pandas, pandas.read_excel — API reference, 2026. pandas.pydata.org/docs/reference/api/pandas.read_excel.html
- [3]pandas, pandas.read_csv — API reference, 2026. pandas.pydata.org/docs/reference/api/pandas.read_csv.html
- [4]pandas, pandas.DataFrame.to_excel — API reference, 2026. pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html
- [5]Microsoft Learn, Task Scheduler, 2026. learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page
- [6]Wikipedia, cron, 2026-10. en.wikipedia.org/wiki/Cron
▶ Free report
See the whole picture before you build.
Download the report to show your management, with sources, why this step matters.
Ready? Book a call directly: Book an intro call →
▶ Related pages