← All lessons
Working with financial documents · Lesson 1 of 7

The documents

Lending, investing and accounting run on documents that people have always read by hand. AI can read them faster, but only if you know what's in each kind and where it trips up. This course is about building those systems so the output can be trusted: every value checked, every sentence traceable to a page, and a person signing off where it matters.

A credit agreement sets out a loan: who lends, who borrows, how much, the interest rate, fees, repayment, covenants, events of default. They run to a hundred pages or more, plus schedules, exhibits and later amendments. The hard part is that words mean what the agreement defines them to mean: "EBITDA" or "Consolidated Total Debt" has its own definition, often with a long list of adjustments, and a clause on page 80 can depend on a definition on page 12. An amendment can change a number without restating the whole document.

An appraisal is a valuer's report on a property: a long narrative, photos, maps, and tables of comparable sales, rents and expenses, ending in a value conclusion. It may give more than one value ("as is" today and "as stabilized" once the property is leased up), and they're easy to mix up.

Financial statements come in three parts. The balance sheet shows what a company owns and owes on one date, and assets equal liabilities plus equity. The income statement shows revenue, costs and profit over a period. The cash flow statement shows cash in and out from operating, investing and financing. The traps: units ("in thousands"), negatives shown in parentheses, several periods side by side, and footnotes that change the meaning of a line.

def amount(text, scale=1000):        # the statement says "in thousands"
    negative = text.startswith("(") and text.endswith(")")
    n = int(text.strip("()").replace(",", "")) * scale
    return -n if negative else n

print(amount("(1,250)"), amount("3,400"))
Prints
-1250000 3400000

A rent roll lists a property's units or tenants: unit, tenant, size, lease start and end, rent. It's usually a spreadsheet exported to a PDF, so the header repeats on every page, columns wrap, and a total row at the end must not be counted as a unit. Operating statements show a property's income and expenses, often month by month for the last twelve months (a "T-12"), with each owner using their own account names. Invoices are short but come in a different layout from every supplier.

Most of these arrive as PDFs: some made by software, some scanned, some a mix. The next lesson is about getting text out of them that's good enough to work with.

Practice

Which statement shows what a company owns and owes on a single date?

More info

Quick reference

Credit agreementThe loan's contract: amounts, pricing, covenants, defaults; defined terms rule.
AppraisalA valuer's report; may give as-is and as-stabilized values.
Balance sheetOne date: assets = liabilities + equity.
Income statementA period: revenue, costs, profit.
Cash flow statementA period: cash from operating, investing and financing.
Rent rollUnit-by-unit leases and rents; watch for repeated headers and total rows.
T-12An operating statement for the trailing twelve months.
(1,250)A negative number; check the units line for the scale.

The other AI and data engineering courses