fmp_py.fmp_splits
Classes
Module Contents
- class fmp_py.fmp_splits.FmpSplits(api_key: str = os.getenv('FMP_API_KEY'))
Bases:
fmp_py.fmp_base.FmpBase- stock_splits_historical(symbol: str) pandas.DataFrame
Retrieves historical stock splits data for a given symbol. :param symbol: The stock symbol. :type symbol: str
- Returns:
A DataFrame containing the historical stock splits data.
- Return type:
pd.DataFrame
- stock_splits_calendar(from_date: str, to_date: str) pandas.DataFrame
Retrieves the stock splits calendar for a given date range. :param from_date: The start date of the date range in “YYYY-MM-DD” format. :type from_date: str :param to_date: The end date of the date range in “YYYY-MM-DD” format. :type to_date: str
- Returns:
- A DataFrame containing the stock splits calendar data with the following columns:
date: The date of the stock split.
label: The label of the stock split.
symbol: The symbol of the stock.
numerator: The numerator of the stock split ratio.
denominator: The denominator of the stock split ratio.
- Return type:
pd.DataFrame
- Raises:
ValueError – If from_date is greater than to_date or if no data is found for the given date range.