跳转至

公募基金(Editing)

FundBaseMapping

字段映射 基金基本信息

FundBase

FundBase(
    fund_code: str,
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 基金基本信息

Notes
from wisecon.fund.fund_value import FundValue

data = FundValue(fund_code="000001").load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
fund_code str

基金代码

required
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志

None
**kwargs Any

其他参数

{}
Source code in wisecon\fund\fund_base.py
def __init__(
        self,
        fund_code: str,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.fund.fund_value import FundValue

        data = FundValue(fund_code="000001").load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        fund_code: 基金代码
        verbose: 是否打印日志
        logger: 自定义日志
        **kwargs: 其他参数
    """
    self.fund_code = fund_code
    self.mapping = FundBaseMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs
    self.request_set(response_type="text", description="基金基本信息",)

FundListMapping

字段映射 全部基金列表

FundList

FundList(
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 全部基金列表

Notes
from wisecon.fund import *

data = FundList().load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志

None
**kwargs Any

其他参数

{}
Source code in wisecon\fund\fund_list.py
def __init__(
        self,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.fund import *

        data = FundList().load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        verbose: 是否打印日志
        logger: 自定义日志
        **kwargs: 其他参数
    """
    self.mapping = FundListMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs
    self.request_set(
        response_type="text",
        description="基金列表",
    )

FundValueMapping

字段映射 基金当前净值

FundValue

FundValue(
    fund_code: str,
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 基金当前净值

Notes
from wisecon.fund.fund_value import FundValue

data = FundValue(fund_code="000001").load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
fund_code str

基金代码

required
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志

None
**kwargs Any

其他参数

{}
Source code in wisecon\fund\fund_value.py
def __init__(
        self,
        fund_code: str,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.fund.fund_value import FundValue

        data = FundValue(fund_code="000001").load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        fund_code: 基金代码
        verbose: 是否打印日志
        logger: 自定义日志
        **kwargs: 其他参数
    """
    self.fund_code = fund_code
    self.mapping = FundValueMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs

    self.request_set(
        response_type="text",
        description="基金当前净值",
    )

FundHistMapping

字段映射 基金历史净值

FundHist

FundHist(
    fund_code: str,
    start_date: Optional[str] = "",
    end_date: Optional[str] = "",
    limit: Optional[int] = 20,
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 基金历史净值

Notes
from wisecon.fund import FundHist

data = FundHist(fund_code="000001", start_date="2020-01-01", end_date="2024-01-01", limit=10).load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
fund_code str

基金代码

required
start_date Optional[str]

开始日期

''
end_date Optional[str]

结束日期

''
limit Optional[int]

返回条数

20
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志

None
**kwargs Any

其他参数

{}
Source code in wisecon\fund\fund_hist.py
def __init__(
        self,
        fund_code: str,
        start_date: Optional[str] = "",
        end_date: Optional[str] = "",
        limit: Optional[int] = 20,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.fund import FundHist

        data = FundHist(fund_code="000001", start_date="2020-01-01", end_date="2024-01-01", limit=10).load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        fund_code: 基金代码
        start_date: 开始日期
        end_date: 结束日期
        limit: 返回条数
        verbose: 是否打印日志
        logger: 自定义日志
        **kwargs: 其他参数
    """
    self.fund_code = fund_code
    self.start_date = start_date
    self.end_date = end_date
    self.limit = limit
    self.mapping = FundHistMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs
    self.request_set(response_type="text", description="基金历史净值", other_headers=other_headers)