fmp_py.fmp_upgrades_downgrades
Classes
Module Contents
- class fmp_py.fmp_upgrades_downgrades.FMPUpgradesDowngrades(api_key: str = os.getenv('FMP_API_KEY'))
Bases:
fmp_py.fmp_base.FmpBase- upgrades_downgrades_consensus(symbol: str) fmp_py.models.upgrades_downgrades.UpgradesDowngrades
Retrieves the upgrades and downgrades consensus data for a given symbol.
- Parameters:
symbol (str) – The symbol of the stock.
- Returns:
An instance of the UpgradesDowngrades class containing the consensus data.
- Return type:
- Raises:
ValueError – If no data is found for the specified parameters.
- upgrades_downgrades_by_company(company: str) pandas.DataFrame
Retrieves upgrades and downgrades grading data for a specific company.
- Parameters:
company (str) – The name of the company.
- Returns:
A DataFrame containing the upgrades and downgrades grading data for the specified company.
- Return type:
pd.DataFrame
- Raises:
ValueError – If no data is found for the specified company.
- upgrades_downgrades_rss_feed(page: int = 0) pandas.DataFrame
Retrieves the upgrades and downgrades RSS feed data from the Financial Modeling Prep API.
- Parameters:
page (int) – The page number of the RSS feed to retrieve. Default is 0.
- Returns:
A pandas DataFrame containing the upgrades and downgrades data.
- Return type:
pd.DataFrame
- Raises:
ValueError – If no data is found for the specified parameters.
- upgrades_downgrades(symbol: str) pandas.DataFrame
Retrieves upgrades and downgrades data for a given symbol.
- Parameters:
symbol (str) – The symbol for which to retrieve upgrades and downgrades data.
- Returns:
A DataFrame containing the upgrades and downgrades data, sorted by published date.
- Return type:
pd.DataFrame
- Raises:
ValueError – If no data is found for the given symbol.
- _process_data(url: str, params: dict) pandas.DataFrame
Process the data obtained from the API response.
- Parameters:
url (str) – The URL for the API request.
params (dict) – The parameters for the API request.
- Returns:
A DataFrame containing the processed data.
- Return type:
pd.DataFrame
- Raises:
ValueError – If no data is found for the given symbol.