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, all_disclosures=False)¶
Disclosures/Footnotes in a DataFrame
formerly know as “document_dataframe”
- Parameters:
company_identifiers (
Sequence
[Union
[str
,int
]]) – list of tickers or CIK codesdisclosure_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 periodsyear (
Optional
[int
]) – The year to searchperiod (
Union
[Period
,Literal
[0
,1
,2
,3
,4
],None
]) – period of data to getperiod_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 periodsprogress_bar (
Optional
[tqdm.std.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 companiesall_disclosures (
bool
) – All disclosures, 10-K/Q XBRL notes, 10-K/Q non-XBRL sections and 8-Ks. Does not include MD&A sections.
- Return type:
pd.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")
- calcbench.disclosures.disclosure_search(company_identifiers=None, full_text_search_term=None, year=None, period=Period.Annual, 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, single_company_period_all_disclosures=False, disclosure_names=[], progress_bar=None, accession_id=None, all_text_blocks=False, all_disclosures=False)¶
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 codesyear (
Optional
[int
]) – Year to get data forfull_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 periodperiod_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 periodsdocument_type (
Optional
[str
]) – Search a specific document type. DEPRECATED use disclosure_names.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 periodsupdated_from (
Optional
[date
]) – include filings from this date and after.sub_divide (
bool
) – return the disclosures split into sections based on headers.single_company_period_all_disclosures (
bool
) – All of the documents for a single company/period. For single company mode on the front-end. Probably not what you want. See all_disclosuresentire_universe (
bool
) – Search all companiesprogress_bar (
Optional
[tqdm.std.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#blockTagsall_text_blocks (
bool
) – All level 1 and accounting policy text blocksall_disclosures (
bool
) – All disclosures, 10-K/Q XBRL notes, 10-K/Q non-XBRL sections and 8-Ks. Does not include MD&A sections.
- 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 >>> )
- 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'¶
- 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
- pydantic model calcbench.models.disclosure_search_results.DisclosureContentsParams¶
Get contents for a disclosure
Corresponds DisclosureContentsParams.cs
-
field disclosure:
DisclosureSearchResults
[Required]¶ Disclosure for which to get contents
-
field standardize:
Optional
[bool
] = False¶ Standardize the disclosure
-
field disclosure:
- pydantic model calcbench.models.disclosure_search_results.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 0x000001F865D737E0>
json_schema_input_type = PydanticUndefined
-
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 0x000001F865D737E0>
json_schema_input_type = PydanticUndefined
-
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 0x000001F865D73600>
json_schema_input_type = PydanticUndefined
-
field guide_link:
Optional
[str
] [Required]¶
-
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(standardize=False)¶
Content of the document, with the filers HTML
- Parameters:
standardize – Translate the contents into standardized/idiomatic HTML
- Return type:
str
- get_contents_text()¶
Contents of the HTML of the document
- Return type:
str
- get_disclosure(standardize=False)¶
Get the disclosure contents from the Calcbench server
- Parameters:
standardize (
bool
) – Translate the contents into standardized/idiomatic HTML- Return type:
DisclosureContent
-
field CIK: