DataLens

Python Project: Toko Kita's order tools

Four graded tasks that use the whole Python track on one shop's data. Clean messy form input, turn a CSV export into a JSON report, model the stockroom with a class, and write tests that catch real bugs.

Track project

Open the project

A realistic brief and graded tasks that use the whole track. Included with Pro.

The brief

Toko Kita is a small Indonesian online shop that sells coffee, kitchen equipment, stationery, home goods and a few electronics. Until now, the owner has done everything by hand in spreadsheets. You've just joined as the first person who can write code, and the team has a short list of jobs for you.

None of these jobs need pandas or a database. They're the kind of everyday Python work that sits underneath bigger projects: cleaning what people type into a form, reading a file someone exported, keeping track of stock, and making sure the code you wrote keeps working after the next change. Each task uses several modules from the Python track at once, so it's a good way to find out which parts have really stuck.

How the tasks work

Each task is checked automatically, like the module questions. The difference is that the instructions read more like a ticket from a colleague than a lesson exercise: they tell you what the result must do, not how to write it. There are hints if you get stuck, but try to pass each task without opening the solution first.

You can do the tasks in any order and run your code as often as you like. If one of them feels much harder than the others, the table below tells you which modules to revisit.

The tasks

#TaskMain skills
1Clean and validate raw ordersFunctions, string methods, raising and catching exceptions
2A city report from the exportReading CSV, dictionaries, sorting, writing JSON
3A stockroom classClasses, methods, properties, custom exceptions
4Tests that catch bugsWriting your own tests

The data

Task 2 uses sales.csv, the shop's order export from January to June 2024. Every row is one line of an order (one product), so an order with three products takes three rows that share the same order_id. The columns are:

order_id, order_date, customer, city, segment, product, category, quantity, unit_price, revenue, channel, status

Like any real export, it has a few rough edges. All the values arrive as text, and a handful of rows have an empty city because the customer skipped that field at checkout. The task tells you how to handle both.

When you're ready, open Task 1.

Open the project

A realistic brief and graded tasks that use the whole track. Included with Pro.