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

Contents of an individual disclosure Corresponds to XBRLDisclosure on the server

field CIK: Optional[str] = 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: Optional[str] [Required]

Not set in single company mode

field entity_id: int [Required]
field entity_name: str [Required]
field fact_id: int [Required]
field fiscal_period: Annotated[Optional[Period]] [Required]

Not set in single company mode

Constraints:
  • func = <function _build_period at 0x000002239C3CF920>

field fiscal_year: Optional[int] [Required]

Not set in single company mode

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

Unaltered HTML from the filing.

pydantic model calcbench.models.disclosure.DisclosureSearchResults

An individual disclosure.

A list of these is returned by the disclosure_search function.

field CIK: Optional[str] [Required]

Not set in single company mode

field SEC_URL: Optional[str] [Required]

Not set in single company mode

field accession_id: Optional[int] [Required]

Not set in single company mode

field blob_id: Optional[str] [Required]
field calendar_period: Annotated[Optional[Period]] [Required]
Constraints:
  • func = <function _build_period at 0x000002239C3CF920>

field calendar_year: Optional[int] [Required]

Not set in single company mode

field content: Optional[DisclosureContent] = None

Not always set. Set for MD&A sections for example.

field date_reported: Optional[datetime] [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: Optional[str] [Required]

Pass this to the API. For XBRL tagged notes this is the DisclosureCategory as defined by the FASB.

field document_type: Optional[str] [Required]

Not set in single company mode

field entity_id: int [Required]
field entity_name: Optional[str] [Required]

Not set in single company mode

field fact_id: Optional[int] = None
field filing_date: str [Required]
field filing_type: int [Required]

Filing type from the filing type enum

field fiscal_period: Annotated[Optional[Period]] [Required]

Not set in single company mode

Constraints:
  • func = <function _build_period at 0x000002239C3CF920>

field fiscal_year: Optional[int] [Required]

Not set in single company mode

field footnote_type: Optional[int] [Required]
field footnote_type_title: Annotated[Optional[FootnoteTypeTitle]] [Required]

Not set in single company mode

Constraints:
  • func = <function footnote_type_title_validator at 0x000002239C3CC860>

field id_detail: bool [Required]
field local_name: Optional[str] [Required]
field name: str [Required]

Section or disclosure name, block tag name. Use this instead of description or local name.

field network_id: Optional[int] [Required]
field page_url: Optional[str] [Required]
field period_end_date: Optional[str] [Required]

Not set in single company mode

field received_date: str [Required]
field sec_accession_number: Optional[str] [Required]
field sec_filing_id: Optional[int] [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()

Get the disclosure contents from the Calcbench server

Return type:

DisclosureContent

class calcbench.models.disclosure.FootnoteTypeTitle(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

This should probably not exist. I think there are an infinite number of titles.

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'
DeferredRevenue = 'Deferred Revenue'
Derivatives = 'Derivative Instruments And Hedging Activities'
EarningPerShare = 'Earnings Per Share'
EigthKsByItemType = '8-Ks By Item Type'
Equity = 'Equity'
ExitOrDisposalCostObligations = 'Exit Or Disposal Cost Obligations'
FinancialInstrumentsAtFairValue = 'Financial Instruments At Fair Value'
Goodwill = 'Goodwill & Intangible Assets'
IncomeTax = 'Income Tax'
InterimReporting = 'Interim Reporting'
Inventory = 'Inventory & PPE'
InvestmentsDebtAndEquitySecurities = 'Investments Debt And Equity Securities'
Leases = 'Leases'
Other = 'Other'
OtherExpenses = 'Other Expenses'
PolicyTextBlock = 'Policy Text Block'
RelatedDocuments = 'Related Documents (Earnings, Proxys & Letters)'
RevenueFromContractWithCustomer = 'Revenuefrom Contract With Customer'
Segment = 'Segment'
TextBlock = 'Text Block'
calcbench.models.disclosure.footnote_type_title_validator(v, handler)

The enum does not have all of the possible Type Titles.

Return type:

Any