Last updated:
0 purchases
pubfin 1.0.0
pubfin
This package provides a Findata class with built-in methods to query, save, and output (to Pandas DataFrame) reported financial data via the SEC EDGAR API.
class Findata
function __init__
__init__(
cik: str,
ticker: str = None,
listing_country: str = 'USA',
request_header: dict = {'User-Agent': 'Default [email protected]'}
)
static method pubfin.load_from_ticker
load_from_ticker(
ticker: str,
listing_country: str = 'USA',
request_header: dict = {'User-Agent': 'Default [email protected]'}
)
Constructs a Findata object using the supplied ticker symbol, looks up the matching SEC CIK id, and queries all available company fact data from the EDGAR API. Currently, this will only work for USA-listed companies accessible through the SEC EDGAR system. This function uses two SEC EDGAR API calls--one to look up the company's CIK id from ticker, and another to load reported financial data.
Args:
ticker (str) : The company's stock ticker symbol
listing_country (str, optional) : The company's listing country. Defaults to "USA"
request_header (dict, optional) : Your name and email, which is required by the SEC's APIs. Defaults to { "User-Agent": "Default [email protected]", }
Returns:
Findata: A Findata object with populated reported financial data (self.data attribute) in a dict representation of the EDGAR API's JSON output.
instance method pubfin.Findata.to_df
Findata.to_df(xbrl_tags: list = None)
Outputs a Findata object's dict representation of reported financial data to a flat Pandas dataframe.
Args:
xbrl_tags (list, optional): List of xbrl tag names (string format) to limit the output dataframe. Defaults to None.
Returns:
Pandas dataframe
This file was automatically generated via lazydocs.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.