Financial statement extraction with normalization.
Three output layers for each statement: raw-* - all matching observations, unprocessed *-statement - normalized, restatement-deduplicated, long-format get-financials - all three statements, optionally wide-format
Concept fallback chains: each line item is a vector of concept names tried in order; the first one present in the facts data wins.
Duration vs instant: Income statement + cash flow -> duration observations (row has :start date) Balance sheet -> instant observations (row has no :start date)
Point-in-time / look-ahead-safe mode: Pass :as-of "YYYY-MM-DD" to any public function to restrict to filings where :filed <= as-of-date. Without :as-of the latest restated value is returned (as-reported / always-latest behaviour).
Quarterly and LTM derivation (10-Q only, flow variables only): :val-q - single-quarter value derived by subtracting prior YTD from current YTD. Q1 = reported value; Q2 = H1 - Q1; etc. :val-ltm - last-twelve-months: sum of four consecutive :val-q values. nil when any of the four quarters is missing.
Financial statement extraction with normalization.
Three output layers for each statement:
raw-* - all matching observations, unprocessed
*-statement - normalized, restatement-deduplicated, long-format
get-financials - all three statements, optionally wide-format
Concept fallback chains: each line item is a vector of concept names tried
in order; the first one present in the facts data wins.
Duration vs instant:
Income statement + cash flow -> duration observations (row has :start date)
Balance sheet -> instant observations (row has no :start date)
Point-in-time / look-ahead-safe mode:
Pass :as-of "YYYY-MM-DD" to any public function to restrict to filings
where :filed <= as-of-date. Without :as-of the latest restated value is
returned (as-reported / always-latest behaviour).
Quarterly and LTM derivation (10-Q only, flow variables only):
:val-q - single-quarter value derived by subtracting prior YTD from
current YTD. Q1 = reported value; Q2 = H1 - Q1; etc.
:val-ltm - last-twelve-months: sum of four consecutive :val-q values.
nil when any of the four quarters is missing.(balance-sheet ticker-or-cik
&
{:keys [form concepts shape as-of]
:or {form "10-K" shape :long}})Return normalized balance sheet as a long-format dataset.
Options: :form - "10-K" (default) or "10-Q" :concepts - override balance-sheet-concepts :shape - :long (default) or :wide :as-of - ISO date string "YYYY-MM-DD" (default nil). When set, excludes filings where :filed > as-of-date, giving point-in-time / look-ahead-safe results.
Return normalized balance sheet as a long-format dataset.
Options:
:form - "10-K" (default) or "10-Q"
:concepts - override balance-sheet-concepts
:shape - :long (default) or :wide
:as-of - ISO date string "YYYY-MM-DD" (default nil).
When set, excludes filings where :filed > as-of-date,
giving point-in-time / look-ahead-safe results.(cash-flow ticker-or-cik
&
{:keys [form concepts shape as-of] :or {form "10-K" shape :long}})Return normalized cash flow statement as a long-format dataset.
Options: :form - "10-K" (default) or "10-Q" :concepts - override cash-flow-concepts :shape - :long (default) or :wide :as-of - ISO date string "YYYY-MM-DD" (default nil). When set, excludes filings where :filed > as-of-date, giving point-in-time / look-ahead-safe results.
For 10-Q queries, long-format output includes :val-q (single-quarter value) and :val-ltm (trailing twelve months) columns derived from YTD subtraction.
Return normalized cash flow statement as a long-format dataset.
Options:
:form - "10-K" (default) or "10-Q"
:concepts - override cash-flow-concepts
:shape - :long (default) or :wide
:as-of - ISO date string "YYYY-MM-DD" (default nil).
When set, excludes filings where :filed > as-of-date,
giving point-in-time / look-ahead-safe results.
For 10-Q queries, long-format output includes :val-q (single-quarter value)
and :val-ltm (trailing twelve months) columns derived from YTD subtraction.(get-financials ticker-or-cik
&
{:keys [form shape as-of] :or {form "10-K" shape :long}})Return all three normalized statements for a company.
Returns {:income-statement ds :balance-sheet ds :cash-flow ds}
Options: :form - "10-K" (default) or "10-Q" :shape - :long (default) or :wide :as-of - ISO date string "YYYY-MM-DD" (default nil). All three statements use point-in-time deduplication: filings where :filed > as-of-date are excluded.
For 10-Q queries, long-format income and cash flow include :val-q and :val-ltm columns. Balance sheet is unaffected (instant observations).
Return all three normalized statements for a company.
Returns {:income-statement ds :balance-sheet ds :cash-flow ds}
Options:
:form - "10-K" (default) or "10-Q"
:shape - :long (default) or :wide
:as-of - ISO date string "YYYY-MM-DD" (default nil).
All three statements use point-in-time deduplication:
filings where :filed > as-of-date are excluded.
For 10-Q queries, long-format income and cash flow include :val-q and
:val-ltm columns. Balance sheet is unaffected (instant observations).(income-statement ticker-or-cik
&
{:keys [form concepts shape as-of]
:or {form "10-K" shape :long}})Return normalized income statement as a long-format dataset.
Options: :form - "10-K" (default) or "10-Q" :concepts - override income-statement-concepts :shape - :long (default) or :wide :as-of - ISO date string "YYYY-MM-DD" (default nil). When set, excludes filings where :filed > as-of-date, giving point-in-time / look-ahead-safe results suitable for backtesting and event studies.
For 10-Q queries, long-format output includes :val-q (single-quarter value) and :val-ltm (trailing twelve months) columns derived from YTD subtraction.
Return normalized income statement as a long-format dataset.
Options:
:form - "10-K" (default) or "10-Q"
:concepts - override income-statement-concepts
:shape - :long (default) or :wide
:as-of - ISO date string "YYYY-MM-DD" (default nil).
When set, excludes filings where :filed > as-of-date,
giving point-in-time / look-ahead-safe results suitable
for backtesting and event studies.
For 10-Q queries, long-format output includes :val-q (single-quarter value)
and :val-ltm (trailing twelve months) columns derived from YTD subtraction.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |