41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
|
|
"""Tushare API wrapper modules.
|
||
|
|
|
||
|
|
This package contains simplified interfaces for fetching data from Tushare API.
|
||
|
|
All wrapper files follow the naming convention: api_{data_type}.py
|
||
|
|
|
||
|
|
Available APIs:
|
||
|
|
- api_daily: Daily market data (日线行情)
|
||
|
|
- api_stock_basic: Stock basic information (股票基本信息)
|
||
|
|
- api_trade_cal: Trading calendar (交易日历)
|
||
|
|
|
||
|
|
Example:
|
||
|
|
>>> from src.data.api_wrappers import get_daily, get_stock_basic, get_trade_cal
|
||
|
|
>>> data = get_daily('000001.SZ', start_date='20240101', end_date='20240131')
|
||
|
|
>>> stocks = get_stock_basic()
|
||
|
|
>>> calendar = get_trade_cal('20240101', '20240131')
|
||
|
|
"""
|
||
|
|
|
||
|
|
from src.data.api_wrappers.api_daily import get_daily
|
||
|
|
from src.data.api_wrappers.api_stock_basic import get_stock_basic, sync_all_stocks
|
||
|
|
from src.data.api_wrappers.api_trade_cal import (
|
||
|
|
get_trade_cal,
|
||
|
|
get_trading_days,
|
||
|
|
get_first_trading_day,
|
||
|
|
get_last_trading_day,
|
||
|
|
sync_trade_cal_cache,
|
||
|
|
)
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
# Daily market data
|
||
|
|
"get_daily",
|
||
|
|
# Stock basic information
|
||
|
|
"get_stock_basic",
|
||
|
|
"sync_all_stocks",
|
||
|
|
# Trade calendar
|
||
|
|
"get_trade_cal",
|
||
|
|
"get_trading_days",
|
||
|
|
"get_first_trading_day",
|
||
|
|
"get_last_trading_day",
|
||
|
|
"sync_trade_cal_cache",
|
||
|
|
]
|