Premium

Report Automation

A report that silently trusts its input produces a polished, wrong number — and nobody double-checks a report that looks finished.

  • Python
  • openpyxl
  • pandas

About this project

A pandas + openpyxl pipeline that turns a raw sales-transactions CSV into a formatted Excel workbook: headline totals, a category breakdown, a city breakdown, and — the part most CSV-to-Excel scripts skip — an explicit, row-by-row list of every transaction the report refused to trust, and exactly why.

The naive version of this script is two lines: read the CSV, sum a column. That runs, and it prints a number, and the number is wrong the moment the file contains any of the problems a real sales export accumulates within a month of someone editing it by hand — a duplicated transaction ID, a return recorded as a negative quantity, a blank or unparseable amount, a stray forward-dated row. None of those raise an exception, so nothing tells you the total is wrong, and a crash gets investigated while a polished-looking wrong number gets forwarded to a manager. This project's validation pass runs every row through seven named checks before anything is summed, excludes a failing row from every total, and writes it — in full, with the reason — to its own "Data Issues" sheet, so the report is auditable rather than just believed.

What you will learn

  • Validate real-world messy input with named, specific checks instead of trusting it
  • Never silently drop a bad row — record every exclusion with a reason, in an auditable place
  • Write real openpyxl formatting: currency number formats, autofilter, frozen headers, conditional rules
  • Reopen and read back the file you just wrote to confirm it, instead of trusting that saving didn't throw
  • Repoint a report script at a different CSV schema by editing one dictionary, not rewriting the pipeline

Before you start

  • Python basics — functions, dictionaries, and reading a CSV with pandas
  • Python 3.10+, plus pandas and openpyxl — one pip command

New to Python? The free Python course covers everything this project assumes.

Academic integrity notice

These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.