Liking cljdoc? Tell your friends :D

edgar.dataset


add-market-cap-rankclj

(add-market-cap-rank ds col)

Sort descending by col and add a :rank column (1 = largest).

Sort descending by col and add a :rank column (1 = largest).
sourceraw docstring

cross-sectional-datasetclj

(cross-sectional-dataset taxonomy concept unit frame)

Build a cross-sectional dataset for a concept across all companies. Uses the SEC frames endpoint (much faster than per-company fetches). taxonomy : "us-gaap" | "dei" | "ifrs-full" concept : e.g. "Assets" "Revenues" unit : e.g. "USD" "shares" frame : e.g. "CY2023Q4I" "CY2023" "CY2022Q3" Returns a dataset sorted by :val descending (as edgar.xbrl/get-concept-frame already returns it).

Build a cross-sectional dataset for a concept across all companies.
Uses the SEC frames endpoint (much faster than per-company fetches).
taxonomy : "us-gaap" | "dei" | "ifrs-full"
concept  : e.g. "Assets" "Revenues"
unit     : e.g. "USD" "shares"
frame    : e.g. "CY2023Q4I" "CY2023" "CY2022Q3"
Returns a dataset sorted by :val descending (as edgar.xbrl/get-concept-frame
already returns it).
sourceraw docstring

filings->datasetclj

(filings->dataset filings & {:keys [name] :or {name "filings"}})

Convert a seq of filing metadata maps to a tech.ml.dataset. Useful for filtering/sorting filing lists with dataset operations.

Convert a seq of filing metadata maps to a tech.ml.dataset.
Useful for filtering/sorting filing lists with dataset operations.
sourceraw docstring

filter-formclj

(filter-form ds form)

Filter a facts dataset to a specific form type.

Filter a facts dataset to a specific form type.
sourceraw docstring

get-filings-datasetclj

(get-filings-dataset ticker-or-cik & opts)

Fetch filings for a company and return as a dataset. Options same as edgar.filings/get-filings.

Fetch filings for a company and return as a dataset.
Options same as edgar.filings/get-filings.
sourceraw docstring

multi-company-factsclj

(multi-company-facts tickers & {:keys [concept form as-of] :or {form "10-K"}})

Fetch XBRL facts for multiple tickers/CIKs and combine into a single dataset. Returns a long-format dataset with an additional :ticker column. If a ticker fails (HTTP error, unknown CIK, etc.) it is skipped silently. If all tickers fail or tickers is empty, returns an empty dataset. Options: :concept - string or collection of concept strings to keep (default all) :form - "10-K" | "10-Q" (default "10-K") :as-of - "YYYY-MM-DD" string; exclude filings submitted after this date and keep only the most recently filed observation per [ticker concept unit start end]

Fetch XBRL facts for multiple tickers/CIKs and combine into a single dataset.
Returns a long-format dataset with an additional :ticker column.
If a ticker fails (HTTP error, unknown CIK, etc.) it is skipped silently.
If all tickers fail or tickers is empty, returns an empty dataset.
Options:
  :concept   - string or collection of concept strings to keep (default all)
  :form      - "10-K" | "10-Q" (default "10-K")
  :as-of     - "YYYY-MM-DD" string; exclude filings submitted after this date
               and keep only the most recently filed observation per [ticker concept unit start end]
sourceraw docstring

pivot-wideclj

(pivot-wide ds)

Pivot a long-format facts dataset to wide format: one row per period (:end) — per [:ticker :end] when the dataset has a :ticker column, as e/panel output does — and one column per :concept, valued from :val.

One observation is kept per [ticker end concept unit]:

  • duration facts: the longest window ending at :end wins (a 10-K's fiscal-year figure over the quarterly-footnote row sharing its end date; a 10-Q's year-to-date figure over its 3-month figure)
  • among observations of the same window length, the most recently :filed wins (restatements) Units are never mixed in one column: a concept reported in a single unit keeps its plain name as the column; a concept reported in several units gets one column per unit, named "<concept> (<unit>)". Rows are sorted by :ticker (when present), then :end descending. Returns a tech.ml.dataset.
Pivot a long-format facts dataset to wide format: one row per period
(:end) — per [:ticker :end] when the dataset has a :ticker column, as
e/panel output does — and one column per :concept, valued from :val.

One observation is kept per [ticker end concept unit]:
  - duration facts: the longest window ending at :end wins (a 10-K's
    fiscal-year figure over the quarterly-footnote row sharing its end
    date; a 10-Q's year-to-date figure over its 3-month figure)
  - among observations of the same window length, the most recently
    :filed wins (restatements)
Units are never mixed in one column: a concept reported in a single unit
keeps its plain name as the column; a concept reported in several units
gets one column per unit, named "<concept> (<unit>)".
Rows are sorted by :ticker (when present), then :end descending.
Returns a tech.ml.dataset.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close