02 · The Ledger Bridge · Operations · Data
Warehouse Inventory Anomaly Checker
Outcome
A working prototype that reconciles system stock records against shelf counts and explains each discrepancy it finds.
Status and role
- Status
- Working prototype on generated demo data. Fictional project for this template.
- Context
- Own project
Stack
- Backend
- Python
- FastAPI
- pandas
- openpyxl
- rapidfuzz
- Data
- PostgreSQL
- SQLAlchemy
- Frontend
- React
- Vite
- Tailwind CSS
- Recharts
Links
The problem
A warehouse runs a cycle count every week and compares it to the stock system by hand. Most differences are harmless typing variations; a few are real losses; some are items in the wrong bin. In a spreadsheet they all look alike.
The aim was to do the matching automatically, sort every difference by its likely cause, and leave the decision to write anything off with a person.
What I built
Analysis engine
A Python package holds the pandas logic and knows nothing about HTTP, so it runs the same from scripts, tests and the API.
API layer
FastAPI handles uploads and returns the reconciled result as one document. Uploaded files are deleted once processed.
Dashboard
A React app shows totals, the discrepancies by cause and a printable recount list.
Upload
Two files and the tolerances to use.
- System records
- Shelf count
Normalise
Item codes, bin codes and units are cleaned so formatting differences do not count as discrepancies.
Reconcile
An outer join sorts every row into one of three groups.
- Only in the system
- Only on the shelf
- In both, with differences
Near-match
Unpaired rows with nearly identical codes or bins are paired and labelled as probable typing errors.
Report
A dashboard groups the discrepancies by cause, with the rows behind each group.
The hard part
Tolerances belong to the user
How small a difference is worth ignoring is a business decision, so it is a setting, not a constant.
Near-matches stay visible
Rows paired by similarity are labelled as such, never silently merged.
No automatic write-offs
The tool explains and lists; a person decides.
Result
A generator script builds demo files with planted typing errors, short counts and misplaced items, so each check has cases to find.
Fictional project: no real accuracy or time-saving figures exist, so none are given.
Limits and next steps
Limitations
- Single warehouse only.
- Units must already match; there is no conversion between packs and pieces.
- No barcode scanner integration.
Next steps
- Track discrepancies over time per item.
- Support several warehouses.
- Export a recount plan to handheld scanners.