fmp_py.fmp_company_information
Attributes
The FmpCompanyInformation class provides methods for retrieving company information data from the Financial Modeling Prep API. |
Classes
Module Contents
- fmp_py.fmp_company_information.CURRENT_DATE
- fmp_py.fmp_company_information.ONE_YEAR_BACK
The FmpCompanyInformation class provides methods for retrieving company information data from the Financial Modeling Prep API. Reference: https://site.financialmodelingprep.com/developer/docs#company-information
- def historical_market_cap(self, symbol: str, from_date: str = PREVIOUS_YEAR, to_date: str = CURRENT_YEAR, limit: int = 500) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#historical-market-cap-company-information
- def all_countries(self) -> List[str]:
Reference: https://site.financialmodelingprep.com/developer/docs#all-countries-company-information
- def all_available_exchanges(self) -> List[str]:
Reference: https://site.financialmodelingprep.com/developer/docs#all-available-exchanges
- def all_available_industries(self) -> List[str]:
Reference: https://site.financialmodelingprep.com/developer/docs#all-available-industries
- def all_available_sectors(self) -> List[str]:
Reference: https://site.financialmodelingprep.com/developer/docs#all-available-sectors
- def analyst_recommendations(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#analyst-recommendation-company-information
- def analyst_estimates(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#analyst-estimates-company-information
- def company_core_info(self, symbol: str) -> CompanyCoreInfo:
Reference: https://site.financialmodelingprep.com/developer/docs#core-info-company-information
- def market_cap(self, symbol: str) -> CompanyMarketCap:
Reference: https://site.financialmodelingprep.com/developer/docs#market-cap-company-information
- def executives(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#executives-company-information
- def stock_grade(self, symbol: str, limit: int = 20) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#stock-grade-company-information
- def stock_screener(self,market_cap_more_than: int = None, market_cap_lower_than: int = None, price_more_than: int = None,
price_lower_than: int = None, beta_more_than: float = None, beta_lower_than: float = None, volume_more_than: int = None, volume_lower_than: int = None, dividend_more_than: float = None, dividend_lower_than: float = None, is_etf: bool = None, is_fund: bool = None, is_actively_trading: bool = None, sector: str = None, industry: str = None, exchange: str = None, limit: int = 1000) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#stock-screener-company-information
- def company_notes(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#company-notes-company-information
- def historical_employee_count(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#historical-employee-company-information
- def compensation_benchmark(self, year: int) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#compensation-benchmark-company-information
- def executive_compensation(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#executive-compensation-company-information
- def company_profile(self, symbol: str) -> CompanyProfile:
Reference: https://site.financialmodelingprep.com/developer/docs#company-profile-company-information
- def company_outlook(self, symbol: str) -> pd.DataFrame:
Reference: https://site.financialmodelingprep.com/developer/docs#company-outlook-company-information
- def stock_peers(self, symbol: str) -> StockPeers:
Reference: https://site.financialmodelingprep.com/developer/docs#stock-peers-company-information
- class fmp_py.fmp_company_information.FmpCompanyInformation(api_key: str = os.getenv('FMP_API_KEY'))
Bases:
fmp_py.fmp_base.FmpBase- stock_peers(symbol: str) fmp_py.models.company_information.StockPeers
Retrieves a list of stock peers for the given symbol.
- Parameters:
symbol (str) – The symbol of the stock.
- Returns:
An instance of the StockPeers class containing the symbol and a list of peers.
- Return type:
- Raises:
ValueError – If no stock peers are found for the given symbol.
- company_outlook(symbol: str) dict
Retrieves the company outlook for the given symbol.
- Parameters:
symbol (str) – The stock symbol of the company.
- Returns:
The company outlook information.
- Return type:
dict
- Raises:
ValueError – If no company outlook is found for the given symbol.
- all_available_exchanges() List[str]
Retrieves a list of all available exchanges.
Returns: List[str]: A list of all available exchanges.
- all_available_industries() List[str]
Retrieves a list of all available industries.
Returns: List[str]: A list of all available industries.
- all_available_sectors() List[str]
Retrieves a list of all available sectors.
Returns: List[str]: A list of all available sectors.
- analyst_recommendations(symbol: str) pandas.DataFrame
Retrieves the analyst recommendations for a given symbol.
- Parameters:
symbol (str) – The symbol of the company.
- Returns:
A DataFrame containing the analyst recommendations.
- Return type:
pd.DataFrame
- analyst_estimates(symbol: str, period: str = 'annual', limit: int = 30) pandas.DataFrame
Retrieves analyst estimates for a given symbol.
- Parameters:
symbol (str) – The symbol of the company.
period (str, optional) – The period for which to retrieve estimates. Defaults to “annual”.
limit (int, optional) – The maximum number of estimates to retrieve. Defaults to 30.
- Returns:
A DataFrame containing the analyst estimates.
- Return type:
pd.DataFrame
- Raises:
ValueError – If the provided period is not one of [“annual”, “quarter”].
- all_countries() List[str]
Retrieves a list of all countries.
Returns: List[str]: A list of all countries.
- historical_market_cap(symbol: str, from_date: str = ONE_YEAR_BACK.strftime('%Y-%m-%d'), to_date: str = CURRENT_DATE.strftime('%Y-%m-%d'), limit: int = 500) pandas.DataFrame
Retrieves the historical market capitalization for a given symbol.
Parameters: symbol (str): The stock symbol of the company.
Returns: pd.DataFrame: A DataFrame containing the historical market capitalization.
- company_core_info(symbol: str) fmp_py.models.company_information.CompanyCoreInfo
Retrieves the core information for a given symbol.
- Parameters:
symbol (str) – The symbol of the company.
- Returns:
An object containing the core information of the company.
- Return type:
- Raises:
ValueError – If there is an error parsing the response.
- market_cap(symbol: str) fmp_py.models.company_information.CompanyMarketCap
Retrieves the market capitalization for a given symbol.
- Parameters:
symbol (str) – The symbol of the company.
- Returns:
An object containing the symbol, market capitalization, and date.
- Return type:
- Raises:
ValueError – If there is an error parsing the response.
- executives(symbol: str) pandas.DataFrame
Retrieves the executives information for a given symbol.
Parameters: symbol (str): The stock symbol of the company.
Returns: pd.DataFrame: A DataFrame containing the executives information.
- stock_grade(symbol: str, limit: int = 20) pandas.DataFrame
Retrieves the stock grade information for a given symbol.
- Parameters:
symbol (str) – The stock symbol.
limit (int, optional) – The maximum number of grades to retrieve. Defaults to 20.
- Returns:
A DataFrame containing the stock grade information, with columns renamed and data types converted.
- Return type:
pd.DataFrame
- stock_screener(market_cap_more_than: int = None, market_cap_lower_than: int = None, price_more_than: int = None, price_lower_than: int = None, beta_more_than: float = None, beta_lower_than: float = None, volume_more_than: int = None, volume_lower_than: int = None, dividend_more_than: float = None, dividend_lower_than: float = None, is_etf: bool = None, is_fund: bool = None, is_actively_trading: bool = None, sector: str = None, industry: str = None, exchange: str = None, limit: int = 1000) pandas.DataFrame
Retrieves a DataFrame of stock information based on the specified criteria.
- Parameters:
market_cap_more_than (int, optional) – Filter stocks with market cap greater than this value.
market_cap_lower_than (int, optional) – Filter stocks with market cap lower than this value.
price_more_than (int, optional) – Filter stocks with price greater than this value.
price_lower_than (int, optional) – Filter stocks with price lower than this value.
beta_more_than (float, optional) – Filter stocks with beta greater than this value.
beta_lower_than (float, optional) – Filter stocks with beta lower than this value.
volume_more_than (int, optional) – Filter stocks with volume greater than this value.
volume_lower_than (int, optional) – Filter stocks with volume lower than this value.
dividend_more_than (float, optional) – Filter stocks with dividend greater than this value.
dividend_lower_than (float, optional) – Filter stocks with dividend lower than this value.
is_etf (bool, optional) – Filter stocks that are ETFs.
is_fund (bool, optional) – Filter stocks that are funds.
is_actively_trading (bool, optional) – Filter stocks that are actively trading.
sector (str, optional) – Filter stocks by sector.
industry (str, optional) – Filter stocks by industry.
exchange (str, optional) – Filter stocks by exchange.
limit (int, optional) – Limit the number of results returned (default is 1000).
- Returns:
DataFrame containing the stock information.
- Return type:
pandas.DataFrame
- company_notes(symbol: str) pandas.DataFrame
Retrieves the company notes for a given symbol.
Parameters: symbol (str): The stock symbol of the company.
Returns: pd.DataFrame: A DataFrame containing the company notes.
- historical_employee_count(symbol: str) pandas.DataFrame
Retrieves the historical employee count for a given symbol.
Parameters: symbol (str): The stock symbol of the company.
Returns: pd.DataFrame: A DataFrame containing the historical employee count.
- compensation_benchmark(year: int = CURRENT_DATE.year) pandas.DataFrame
Retrieves compensation benchmark data for a specific year.
- Parameters:
year (int) – The year for which to retrieve the compensation benchmark data.
- Returns:
A DataFrame containing the compensation benchmark data.
- Return type:
pd.DataFrame
- executive_compensation(symbol: str) pandas.DataFrame
- company_profile(symbol: str) fmp_py.models.company_information.CompanyProfile
Retrieves the company profile information for a given symbol symbol.
- Parameters:
symbol (str) – The symbol symbol of the company.
- Returns:
A dataclass object containing the company profile information.
- Return type: