The hard part of comparing companies financially isn't the math — it's the labels. Every filer tags its 10-K differently, so the same dollar of expense shows up under a different name at every company. I built a Python pipeline that solves that tagging problem directly: it pulls five years of income statement, balance sheet, and cash flow data from SEC EDGAR for Walmart, Costco, Target, Kroger, and Best Buy, then classifies and reconciles every company-specific label into a standardized set of categories — automatically, with no hardcoded mapping table to maintain.
Tagging is the automation, not a step before it
Most "automated" financial analysis tools skip straight to the ratios and assume the tagging problem is already solved. This pipeline treats tagging as the actual engineering challenge: a per-company label dictionary routes income statement items to standardized tags, while balance sheet and cash flow items are classified by type — so the mapping logic generalizes instead of being rebuilt by hand for every company.
The pipeline also never overwrites its source: raw statements are saved before any cleaning, issues are explicitly flagged for review, and only then is a cleaned, tagged version produced — so every standardized value can be traced back to the exact line item it came from.
The Filing-to-Tag Pipeline
Six stages · one script · re-runnable the moment a new 10-K drops
Every stage is deterministic code. No LLM calls — the mapping logic is rule-based, which is what makes it reusable across any new peer set.
Walmart · Costco · Target · Kroger · Best Buy — five years of tagged, standardized income statement, balance sheet, and cash flow data for each.
edgartools