def index() -> pd.Series: """Загрузка данных по индексу полной доходности с учетом российских налогов - MCFTRR.""" table_name = outer.TableName(outer.INDEX, outer.INDEX) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) start_date = bootstrap.get_start_date() return df.loc[start_date:, col.CLOSE] # type: ignore
def dividends(ticker: str, force_update: bool = False) -> pd.DataFrame: """Дивиденды для данного тикера.""" table_name = outer.TableName(outer.DIVIDENDS, ticker) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name, force_update) start_date = bootstrap.get_start_date() return df.loc[start_date:] # type: ignore
def cpi() -> pd.Series: """Потребительская инфляция.""" table_name = outer.TableName(outer.CPI, outer.CPI) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) start_date = bootstrap.get_start_date() return df.loc[start_date:, col.CPI] # type: ignore
def dohod(ticker: str) -> pd.DataFrame: """Информация по дивидендам с dohod.ru.""" table_name = outer.TableName(outer.DOHOD, ticker) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) start_date = bootstrap.get_start_date() return df.loc[start_date:] # type: ignore
def lot_size(tickers: Tuple[str, ...]) -> pd.Series: """Информация о размере лотов для тикеров. :param tickers: Перечень тикеров, для которых нужна информация. :return: Информация о размере лотов. """ table_name = outer.TableName(outer.SECURITIES, outer.SECURITIES) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) return df.loc[list(tickers), col.LOT_SIZE]
def quotes(tickers: Tuple[str, ...]) -> List[pd.DataFrame]: """Информация о котировках для заданных тикеров. :param tickers: Перечень тикеров, для которых нужна информация. :return: Список с котировками. """ group: outer.GroupName = outer.QUOTES requests_handler = bootstrap.get_handler() dfs = requests_handler.get_dfs(group, tickers) start_date = bootstrap.get_start_date() return [df.loc[start_date:] for df in dfs] # type: ignore
def smart_lab() -> pd.DataFrame: """Информация по дивидендам с smart-lab.ru.""" table_name = outer.TableName(outer.SMART_LAB, outer.SMART_LAB) requests_handler = bootstrap.get_handler() return requests_handler.get_df(table_name)
def securities_with_reg_number() -> pd.Index: """Все акции с регистрационным номером.""" table_name = outer.TableName(outer.SECURITIES, outer.SECURITIES) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) return df.dropna(axis=0).index
def last_history_date() -> pd.Timestamp: """Последняя доступная дата исторических котировок.""" table_name = outer.TableName(outer.TRADING_DATES, outer.TRADING_DATES) requests_handler = bootstrap.get_handler() df = requests_handler.get_df(table_name) return pd.Timestamp(df.loc[0, "till"])