Donut Shop Sales & Operations Analysis: Polars, Plotly and PostgreSQL
What this is
A data analysis project that turns a donut shop's database into clear, interactive insights about sales, inventory and staff. It reads live data straight from a PostgreSQL database, so the results always match what is happening in the business. There are no manual exports and no copy-pasted spreadsheets.
Why Polars, not the usual pandas
Most data analysis today is done with pandas. For this project I used Polars, a modern, high-performance data library written in Rust. I built the shop's database to scale, and the analysis needed to scale with it.
Fast on big data: Polars uses all of your computer's CPU cores, so it stays fast as the data grows from thousands of rows to millions.
Memory-efficient: it handles large datasets without slowing down or running out of memory.
Built for growth: when the business adds more sales, customers and locations, the analysis keeps working without being rewritten.
Live connection with ConnectorX
The analysis connects to PostgreSQL through ConnectorX, a database connector built for fast loading, and it loads data directly into Polars. Each run pulls the latest data, so a client can refresh the analysis at any time and see current numbers.
Interactive charts with Plotly
All charts are made with Plotly, so they are interactive and not just pictures. Hover over any bar, line or data point to see the exact values, and zoom in or turn data series on and off to explore the details yourself.
What the analysis covers
Sales & revenue: top-selling donuts, sales trends by month, sales by
category, and total profit.
Inventory & waste: ingredient purchases, wasted donuts, and the money
lost to waste.
Staff & operations: employees by shift and age group, and
salary summaries.
Tools: Python, Polars, ConnectorX, Plotly, PostgreSQL
0 likes · 0 views · Oct 22, 2026
Donut Shop Sales & Operations Analysis: Polars, Plotly and PostgreSQL What this is A data analysis project that turns a donut shop's database into clear, int...