Python automation
Weekly Sales Report
A script that turns a café's till export into a one-page sales report and emails it to the owner every Sunday morning, with nobody opening Excel.
- Role
- Solo
- For
- Cafés, shops, any business with a till
- Runs
- Every Sunday at 7:00, by itself
- Status
- Working demo with sample data
Why build it
Most small businesses already have the numbers. The till saves every sale, and once a week someone exports it to Excel. Then the file sits there, because turning thousands of rows into “how did we do this week?” means sorting, fixing and adding up by hand.
This automation does that part. The owner doesn't learn anything new or install anything: a short PDF just shows up in their email every Sunday morning.
Cleaning up the export
Real till exports are messy, and most of the work is there. The sample file is built the way they really look, and the script deals with all of it:
- A title block above the table, so it finds the header row instead of assuming row 1
- Dates saved as real dates on some rows and as text on others
- The same item typed differently (“הפוך”, “הפוך ” and “קפה הפוך”), merged by a list the owner can edit
- Empty line totals, filled from quantity, price and discount
- Refunds as negative quantities, blank rows, and a totals row at the bottom that must not be counted twice
What the owner gets
One A4 page in Hebrew: revenue, number of receipts and the average receipt, each with its change from the week before. Then sales by day next to last week, the busiest hours, the best sellers and how customers paid.
At the top are a few sentences written from the numbers, like the busiest hour with a hint to staff it, or the item whose sales jumped. Most owners won't read a chart, but they'll read three lines.
How it's built
Plain Python with one library, openpyxl, for reading Excel. The report is an HTML page that Edge prints to PDF, so Hebrew and right-to-left layout come out right without fighting a PDF library. The charts are drawn as SVG by the script itself.
The email goes out over SMTP, through whatever mailbox the business already uses. Windows Task Scheduler runs the script every Sunday at 7:00. If the email settings are missing, it saves the email as a file instead of failing, so it can be checked first.
For a real business
The column names, item spellings and the business name are settings at the top of the script, so adapting it to another till is mostly filling those in. From there it can be extended to pick up the export from a shared folder or Google Drive, or to send the summary on WhatsApp instead of email.
What it does
- Reads the till's Excel export as it comes, title block and all
- Fixes what tills get wrong: dates saved as text, the same item typed three ways, missing totals
- Revenue, receipts and average receipt, each compared with the week before
- Sales by day and by hour, best sellers, and how customers paid
- A few plain sentences on what changed, then a PDF in the owner's inbox
Built with
- Python
- openpyxl
- HTML to PDF
- SMTP
- Task Scheduler
Gallery

Next project
RFID Door Lock
An access-control lock for my own door: tap a card and it opens. I designed the circuit board myself and wrote the firmware that runs it.
Want something like this for your business?
Tell me what you need and I'll get back to you with next steps.