Disclosures/Text

It is easy to access the contents of SEC filings 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

Footnotes and other text

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

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

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

  • 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[Literal[‘annual’, ‘quarterly’]]) – only applicable when other period data not supplied. Use “annual” to only search end-of-year documents.

  • 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 document 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

Return type

Generator[DocumentSearchResults, None, None]

Returns

A iterator of DocumentSearchResults

Usage:

>>> import tqdm
>>> sp500 = calcbench.tickers(index='SP500')
>>> with tqdm.tqdm() as progress_bar:
>>>     risk_factors = list(calcbench.document_search(company_identifiers=sp500, disclosure_names=['Risk Factors'], all_history=True, progress_bar=progress_bar))
calcbench.disclosures.document_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=False)

Disclosures/Footnotes in a 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. 0 for annual data, 1, 2, 3, 4 for quarterly data.

  • period_type (Optional[Literal[‘annual’, ‘quarterly’]]) – “quarterly” or “annual”, only applicable when other period data not supplied. Use “annual” to only search end-of-year documents.

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

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

Return type

DataFrame

Returns

A DataFrame indexed by document name -> company identifier.

Usage:

>>> data = calcbench.document_dataframe(company_identifiers=["msft", "goog"], all_history=True, disclosure_names=["Management's Discussion And Analysis", "Risk Factors"])
>>> data = data.fillna(False)
>>> word_counts = data.applymap(lambda document: document and len(document.get_contents_text().split()))
class calcbench.disclosures.DisclosureContent(**kwargs)
blobs: Sequence[str] = None
class calcbench.disclosures.DocumentSearchResults(**kwargs)

Represents a disclosure.

CIK: str = None
SEC_URL: str = None
accession_id: int = None
blob_id: str = None
calendar_period: str = None
calendar_year: int = None
content: Optional[calcbench.disclosures.DisclosureContent] = None
property date_reported

Time (EST) the document was available from Calcbench

Return type

Optional[datetime]

description: str = None
disclosure_type_name: str = None
document_type: str = None
entity_id: int = None
entity_name: str = None
fact_id: int = None
filing_date: str = None
filing_type: int = None
fiscal_period: str = None
fiscal_year: int = None
footnote_type: str = None
footnote_type_title: FootnoteTypeTitle = None
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

id_detail: bool = None
local_name: str = None
network_id: int = None
page_url: str = None
period_end_date: str = None
received_date: str = None
sec_accession_number: str = None
sec_filing_id: int = None
ticker: str = None
class calcbench.disclosures.FootnoteTypeTitle

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'
calcbench.disclosures.document_contents(blob_id, SEC_ID, SEC_URL=None)
Return type

str

calcbench.disclosures.document_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=False)

Disclosures/Footnotes in a 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. 0 for annual data, 1, 2, 3, 4 for quarterly data.

  • period_type (Optional[Literal[‘annual’, ‘quarterly’]]) – “quarterly” or “annual”, only applicable when other period data not supplied. Use “annual” to only search end-of-year documents.

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

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

Return type

DataFrame

Returns

A DataFrame indexed by document name -> company identifier.

Usage:

>>> data = calcbench.document_dataframe(company_identifiers=["msft", "goog"], all_history=True, disclosure_names=["Management's Discussion And Analysis", "Risk Factors"])
>>> data = data.fillna(False)
>>> word_counts = data.applymap(lambda document: document and len(document.get_contents_text().split()))
calcbench.disclosures.document_search(company_identifiers=None, full_text_search_term=None, year=None, period=<Period.Annual: 0>, period_type=None, document_type=None, block_tag_name=None, entire_universe=False, use_fiscal_period=False, document_name=None, all_history=False, updated_from=None, batch_size=100, sub_divide=False, all_documents=False, disclosure_names=[], progress_bar=None, accession_id=None)

Footnotes and other text

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

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

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

  • 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[Literal[‘annual’, ‘quarterly’]]) – only applicable when other period data not supplied. Use “annual” to only search end-of-year documents.

  • 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 document 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

Return type

Generator[DocumentSearchResults, None, None]

Returns

A iterator of DocumentSearchResults

Usage:

>>> import tqdm
>>> sp500 = calcbench.tickers(index='SP500')
>>> with tqdm.tqdm() as progress_bar:
>>>     risk_factors = list(calcbench.document_search(company_identifiers=sp500, disclosure_names=['Risk Factors'], all_history=True, progress_bar=progress_bar))