SEC Financial Statement Data Sets (DERA) access. https://www.sec.gov/dera/data/financial-statement-data-sets
Quarterly ZIPs containing four tab-delimited tables: sub — one row per submission: adsh, cik, name, sic, form, period, fy, fp, filed, and filer metadata num — one row per numeric fact: adsh, tag, version, ddate, qtrs, uom, segments, value pre — statement placement: adsh, stmt (BS/IS/CF/EQ/CI), report, line, tag — i.e. which statement each tag appeared on and in what order tag — tag metadata: version, custom flag, datatype, iord (instant/ duration), crdr (credit/debit), label, documentation
Why this matters for standardization: unlike the companyfacts API, these sets include company extension tags and statement placement — the two ingredients Compustat-style cross-company standardization needs most. One bulk download covers every filer for a quarter, instead of one HTTP call per company.
Usage: (require '[edgar.fsds :as fsds]) (def zip (fsds/download-quarter! 2024 1 "/data/fsds")) (def sub (fsds/load-table zip :sub)) (def num (fsds/load-table zip :num)) (def pre (fsds/load-table zip :pre))
;; e.g. income statement placement for one filing: ;; (-> pre ;; (ds/filter-column :adsh #(= % "0000320193-24-000006")) ;; (ds/filter-column :stmt #(= % "IS")))
SEC Financial Statement Data Sets (DERA) access.
https://www.sec.gov/dera/data/financial-statement-data-sets
Quarterly ZIPs containing four tab-delimited tables:
sub — one row per submission: adsh, cik, name, sic, form, period,
fy, fp, filed, and filer metadata
num — one row per numeric fact: adsh, tag, version, ddate, qtrs,
uom, segments, value
pre — statement placement: adsh, stmt (BS/IS/CF/EQ/CI), report, line,
tag — i.e. which statement each tag appeared on and in what order
tag — tag metadata: version, custom flag, datatype, iord (instant/
duration), crdr (credit/debit), label, documentation
Why this matters for standardization: unlike the companyfacts API, these
sets include company extension tags and statement placement — the two
ingredients Compustat-style cross-company standardization needs most.
One bulk download covers every filer for a quarter, instead of one HTTP
call per company.
Usage:
(require '[edgar.fsds :as fsds])
(def zip (fsds/download-quarter! 2024 1 "/data/fsds"))
(def sub (fsds/load-table zip :sub))
(def num (fsds/load-table zip :num))
(def pre (fsds/load-table zip :pre))
;; e.g. income statement placement for one filing:
;; (-> pre
;; (ds/filter-column :adsh #(= % "0000320193-24-000006"))
;; (ds/filter-column :stmt #(= % "IS")))(download-quarter! year quarter dir & {:keys [force?]})Download the FSDS zip for year/quarter into dir. Skips the download when the file already exists unless :force? is true. Returns the path of the zip file.
Note: these files are large (tens to hundreds of MB).
Download the FSDS zip for year/quarter into dir. Skips the download when the file already exists unless :force? is true. Returns the path of the zip file. Note: these files are large (tens to hundreds of MB).
(load-table zip-path table)Load one FSDS table from a downloaded zip as a tech.ml.dataset. table: :sub | :num | :pre | :tag Columns are keywordized. num.txt for a busy quarter has millions of rows — loading it needs a correspondingly sized heap.
Load one FSDS table from a downloaded zip as a tech.ml.dataset. table: :sub | :num | :pre | :tag Columns are keywordized. num.txt for a busy quarter has millions of rows — loading it needs a correspondingly sized heap.
(quarter-url year quarter)URL of the FSDS zip for a year/quarter, e.g. (quarter-url 2024 1).
URL of the FSDS zip for a year/quarter, e.g. (quarter-url 2024 1).
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 |