Disclosures/Text

Download text of SEC filings and 10-K/Q sections from Calcbench.

Calcbench parses the sections of the 10-K/Q such as Management’s Discussion and Analysis and Risk Factors. See the list of available sections @ https://www.calcbench.com/disclosure_list

calcbench.disclosures.disclosure_dataframe(company_identifiers=[], disclosure_names=[], all_history=False, year=None, period=None, progress_bar=None, period_type=None, identifier_key='ticker', block_tag_names=[], use_fiscal_period=True, entire_universe=False, batch_size=100)

Disclosures/Footnotes in a DataFrame

formerly know as “document_dataframe”

Parameters:
  • company_identifiers (Sequence[Union[str, int]]) – list of tickers or CIK codes

  • disclosure_names (Sequence[str]) – The sections to retrieve, see the full list @ https://www.calcbench.com/disclosure_list. You cannot request XBRL and non-XBRL sections in the same request. eg. [‘Management’s Discussion And Analysis’, ‘Risk Factors’]

  • all_history (bool) – Search all time periods

  • year (Optional[int]) – The year to search

  • period (Union[Period, Literal[0, 1, 2, 3, 4], None]) – period of data to get

  • period_type (Optional[PeriodType]) – Only applicable when other period data not supplied. Use “annual” to only search end-of-year documents, “quarterly” is all history all periods

  • progress_bar (Optional[tqdm]) – Pass a tqdm progress bar to keep an eye on things.

  • identifier_key (Literal[‘ticker’, ‘CIK’]) – how to index the returned DataFrame.

  • use_fiscal_period (bool) – Index disclosure by fiscal, as opposed to calendar periods.

  • entire_universe (bool) – Data for all companies

Return type:

DataFrame

Returns:

A DataFrame of DisclosureSearchResults indexed by document name -> company identifier. An empty frame if no results are found.

Usage:

>>> data = calcbench.disclosure_dataframe(company_identifiers=["msft", "goog"],
>>>                                     all_history=True,
>>>                                     disclosure_names=["ManagementsDiscussionAndAnalysis", "RiskFactors"],
>>>                                     period_type="annual")
>>> word_counts = data.applymap(lambda disclosure: disclosure.get_contents_text().split()
>>>                             na_action="ignore")

Footnotes and other text

Search for footnotes and other sections of 10-K, see https://www.calcbench.com/footnote.

Formerly know as “document_search”

Parameters:
  • company_identifiers (Optional[Sequence[Union[str, int]]]) – list of tickers or CIK codes

  • year (Optional[int]) – Year to get data for

  • full_text_search_term (Optional[str]) – Use Calcbench’s full text index to search documents. Documents are returned in decreasing order of relevance as defined by TF-IDF. Use Lucene query syntax, https://lucene.apache.org/core/2_9_4/queryparsersyntax.html. You can restrict the documents search by setting the document_type. For instance, ‘commentLetter’, ‘EarningsPressReleaseFrom8K’, ‘eightk_all_types’

  • period (Union[Period, Literal[0, 1, 2, 3, 4], None]) – period of data to get. 0 for annual data, 1, 2, 3, 4 for quarterly data.

  • use_fiscal_period (bool) – interpret the passed period as a fiscal period, as opposed to calendar period

  • period_type (Optional[PeriodType]) – only applicable when other period data not supplied. Use “annual” to only search end-of-year disclosures, “quarterly” is all history all periods

  • document_type (Optional[str]) – Search a specific document type.

  • disclosure_names (Sequence[str]) – The sections to retrieve, see the full list @ https://www.calcbench.com/disclosure_list. You cannot request XBRL and non-XBRL sections in the same request. eg. [‘Management’s Discussion And Analysis’, ‘Risk Factors’]

  • all_history (bool) – Search all time periods

  • updated_from (Optional[date]) – include filings from this date and after.

  • sub_divide (bool) – return the disclosures split into sections based on headers.

  • all_documents (bool) – all of the documents for a single company/period.

  • entire_universe (bool) – Search all companies

  • progress_bar (Optional[tqdm]) – Pass a tqdm progress bar to keep an eye on things.

  • block_tag_name (Optional[str]) – Level 2 or 3 XBRL tag. See the list of FASB tags @ https://www.calcbench.com/disclosure_list#blockTags

  • all_text_blocks (bool) – All level 1 and accounting policy text blocks

Return type:

Generator[DisclosureSearchResults, None, None]

Returns:

A iterator of DisclosureSearchResults

Usage:

>>> import tqdm
>>> sp500 = calcbench.tickers(index="SP500")
>>> with tqdm.tqdm() as progress_bar:
>>>     risk_factors = calcbench.disclosure_search(
>>>          company_identifiers=sp500,
>>>          disclosure_names=["RiskFactors"],
>>>          all_history=True,
>>>          progress_bar=progress_bar
>>>     )
pydantic model calcbench.models.disclosure.DisclosureContent

Corresponds to XBRLDisclosure on the server

field CIK: str | None = None
field accession_id: int [Required]
field blobs: Sequence[str] [Required]

There will be more than one blob when multiple blocks map to the same network.

field disclosure_type: int [Required]

ArcRole

field document_type: str [Required]
field entity_id: int [Required]
field entity_name: str [Required]
field fact_id: int [Required]
field fiscal_period: Period | None[Period | None] [Required]
Constraints:
  • func = <function _build_period at 0x00000161CECEF790>

field fiscal_year: int [Required]
field is_detail: bool [Required]
field label: str [Required]
field last_in_group: bool [Required]
field local_name: str | None = None
field networkID: int [Required]
field sec_accession_number: str | None = None
field sec_html_url: str [Required]
field table_list: list | None = None
field ticker: str | None = None
property contents: str
Return type:

str

pydantic model calcbench.models.disclosure.DisclosureSearchResults

An individual disclosure.

field CIK: str [Required]
field SEC_URL: str [Required]
field accession_id: int [Required]
field blob_id: str | None [Required]
field calendar_period: Period | None[Period | None] [Required]
Constraints:
  • func = <function _build_period at 0x00000161CECEF790>

field calendar_year: int [Required]
field content: DisclosureContent | None = None
field date_reported: datetime | None [Required]

Time (EST) the document was available from Calcbench

field description: str [Required]

The name passed to the API, not set for 8-Ks, assigned by Calcbench. We try to assign each disclosure to a category.

field disclosure_type_name: str [Required]
field document_type: str [Required]
field entity_id: int [Required]
field entity_name: str [Required]
field fact_id: int | None = None
field filing_date: str [Required]
field filing_type: int [Required]

Human readable disclosure name as reported by the filer, “Related Party Transactions”, “Subsequent Events”

field fiscal_period: Period[Period] [Required]
Constraints:
  • func = <function _build_period at 0x00000161CECEF790>

field fiscal_year: int [Required]
field footnote_type: int | None [Required]
field footnote_type_title: FootnoteTypeTitle [Required]
field id_detail: bool [Required]
field local_name: str | None [Required]
field network_id: int | None [Required]
field page_url: str | None [Required]
field period_end_date: str [Required]
field received_date: str [Required]
field sec_accession_number: str | None [Required]
field sec_filing_id: int | None [Required]
field ticker: str [Required]
get_contents()

Content of the document, with the filers HTML

Return type:

str

get_contents_text()

Contents of the HTML of the document

Return type:

str

get_disclosure()

Content of the document, with the filers HTML

Return type:

DisclosureContent

class calcbench.models.disclosure.FootnoteTypeTitle(value)

An enumeration.

AccountingPolicies = 'Accounting Policies'
AdditionalSections = 'Additional 10-K and 10-Q Sections'
BusinessCombinations = 'Business Combinations'
CashAndEquivalents = 'Cash And Cash Equivalents'
CommitmentsAndContigencies = 'Commitment And Contingencies'
Compensation = 'Compensation Related Costs Postemployment Benefits'
Debt = 'Debt'
Derivatives = 'Derivative Instruments And Hedging Activities'
EarningPerShare = 'Earnings Per Share'
EigthKsByItemType = '8-Ks By Item Type'
Equity = 'Equity'
Goodwill = 'Goodwill & Intangible Assets'
IncomeTax = 'Income Tax'
InterimReporting = 'Interim Reporting'
Inventory = 'Inventory & PPE'
Leases = 'Leases'
Other = 'Other'
OtherExpenses = 'Other Expenses'
PolicyTextBlock = 'Policy Text Block'
RelatedDocuments = 'Related Documents (8-Ks, Proxys & Letters)'
RevenueFromContractWithCustomer = 'Revenuefrom Contract With Customer'
Segment = 'Segment'
TextBlock = 'Text Block'