Build a sales-record analyser in Python

The capstone project for Python for Beginners — a free Data & Tech course. Pass it and you earn a certificate anyone can verify.

Start the course free Download the project workbook

The project unlocks once you complete the lessons. The workbook is free to download now so you can see exactly what is expected.

What you will submit

A shareable Google Colab notebook link (Anyone with the link → Viewer) containing your CSV loading step, your cleaning functions, your analysis loop, and the printed naira report visible in the saved cell outputs.

What to do, step by step

  1. Make a CSV of at least 30 sales rows with the columns date, product, quantity, unit_price — either export real records (a Moniepoint/OPay/Paystack transaction export, or a Google Sheet you keep) or type 30 rows for a business you actually know. If you use a real export, anonymise it first: delete phone and account number columns and replace customer names with "Customer 1", "Customer 2" — the notebook you submit will be publicly viewable. Then deliberately leave 3 rows messy: one blank quantity, one amount written as "₦1,500", and one row with a stray space or wrong text in a number column.
  2. Open a new Google Colab notebook, name it "Sales Analyser — <your name>", upload the CSV (folder icon in the left sidebar, or files.upload()), and read it with csv.DictReader into a list of dictionaries. Using pandas as well is welcome, but not as a replacement for the plain-Python reading step.
  3. Write at least two functions of your own — for example clean_amount(text) to strip ₦ signs and commas, and safe_int(text) to convert quantities — each with a docstring, and use try/except so that a bad row is reported and skipped instead of crashing the whole run.
  4. Loop over the cleaned rows to build tally dictionaries: revenue by product, units by product, and revenue by date. Use the get(key, 0) accumulator pattern, then sort the tallies to rank them.
  5. Print a report showing total revenue, number of valid rows, number of rows skipped, the top 3 products by revenue, the best and worst sales day, and the average sale value — with every naira figure formatted using :,.2f.
  6. Run all cells once so the outputs are visible, check one last time that no real person's name, phone number or account number is left in your data or your printed outputs, then set Share to "Anyone with the link → Viewer" and submit the notebook link.

Files to work with

Project workbook (fill in, then submit)The whole brief, an evidence checklist, the grading rubric as a self-check and the link-sharing steps in one file. Opens in Word, Google Docs or WPS.Word · 7 KB

How it is graded

CriterionWeight
The notebook is publicly viewable and runs top to bottom without crashing, with the CSV loading step and all outputs visible in the saved cells, and no real person's personal details (names, phone or account numbers) left in the data or outputs20%
Core Python used correctly: variables and type conversion, at least one loop, at least two of the learner's own functions with parameters and return values, and a list-of-dictionaries or dictionary data structure25%
Reads a CSV of 30+ rows and handles messy data — ₦ signs, commas, blanks or bad text — via cleaning functions and try/except, reporting skipped rows instead of silently ignoring or crashing on them20%
Produces a complete, correctly calculated report: total revenue, valid and skipped row counts, top 3 products by revenue, best and worst day, and average sale value, all naira figures formatted to two decimals with thousands separators25%
Code is readable and honest: meaningful variable names, comments or docstrings explaining the tricky parts, and no copy-pasted repetition where a function would do10%

You need 65% overall to pass. A failed submission comes back with feedback and can be revised and resubmitted.

Before you submit: make your link public

If your work lives in Google Drive or Google Docs, open Share → General access and change “Restricted” to “Anyone with the link” (Viewer). Then paste the link into a private browser window: if it opens without sign-in, you are ready. A private link cannot be graded — it is the single most common reason a good project fails.

Frequently asked questions

Do I have to finish Python for Beginners before submitting the project?

Yes. The submission screen opens once every lesson in Python for Beginners is marked complete. The lessons are where the methods, the Nigerian context and the worked examples the project depends on are taught.

How is the project graded?

An examiner scores each rubric criterion from 0 to 100 and weights them as shown on this page; you need 65% overall to pass. Most submissions are graded within minutes and you get written feedback on what was strong and what to improve.

Can I resubmit if I fail?

Yes. A failed project comes back with feedback; revise the weak parts and resubmit. A passed project is final — the certificate is issued and cannot be re-rolled.

What do I actually submit?

A write-up of what you did (under 5,000 characters) plus a public link to your work — a Google Drive folder, Google Doc, spreadsheet, GitHub repository or video. The link must open without sign-in; a private link cannot be graded. The free project workbook on this page walks you through all 6 steps.

Is the certificate real?

Yes. Passing this project issues a certificate with a unique verification code. Anyone — an employer, a client, a school — can open the verification page and see that the certificate is genuine and which project earned it.

More Data & Tech projects

Ready to earn this certificate?

Python for Beginners is free and self-paced. Finish the lessons, complete this project, and the certificate is yours to share.

Start learning free