Back to AI projects
NYU Stern Individual Project · Apr 2026

Tagging

An Automated Pipeline for Financial Statement Tagging — From Raw Filings to Standardized Data

Stack Python · edgartools · pandas · openpyxl
Data source SEC EDGAR 10-K filings (XBRL + HTML)
Scope 5 companies · 5 fiscal years · 3 statements, fully tagged
The story

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.

Why it matters

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.

Real-world impact
5 labels 1 tag
What "Trade accounts payable," "Accounts payable," and three other names for the same line item become, automatically
How it works

The Filing-to-Tag Pipeline

Six stages · one script · re-runnable the moment a new 10-K drops

Stage 1
Fetch
Pull five years of 10-K filings for each company from SEC EDGAR
edgartools
Stage 2
Capture
Save raw income statement, balance sheet, and cash flow exactly as filed
Raw JSON
Stage 3
Reconcile
Resolve duplicate labels, mismatched fiscal years, missing values
Python
Stage 4
Tag
Map every label to a standardized category by dictionary and position
Label dict
Stage 5
Enrich
Fetch supporting data with a tiered, no-guess fallback
XBRL + Text
Stage 6
Output
Produce a standardized, tagged dataset, traceable to its source
Tagged Dataset

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.

Companies covered

Walmart · Costco · Target · Kroger · Best Buy — five years of tagged, standardized income statement, balance sheet, and cash flow data for each.

Architecture
Data source
SEC EDGAR · 10-K filings (XBRL + HTML) via edgartools
Processing
Python · pandas · openpyxl
Fallback parsing
BeautifulSoup + regex over Item 1 narrative text
Output
Standardized, tagged financial statement dataset — ready for any downstream model
Agentic AI Python SEC EDGAR Financial Modeling